{"action":"created","issue":{"url":"https://api.github.com/repos/dfahlander/Dexie.js/issues/429","repository_url":"https://api.github.com/repos/dfahlander/Dexie.js","labels_url":"https://api.github.com/repos/dfahlander/Dexie.js/issues/429/labels{/name}","comments_url":"https://api.github.com/repos/dfahlander/Dexie.js/issues/429/comments","events_url":"https://api.github.com/repos/dfahlander/Dexie.js/issues/429/events","html_url":"https://github.com/dfahlander/Dexie.js/issues/429","id":198159684,"number":429,"title":"Dexie.Observable possible bug in message passing","user":{"login":"nponiros","id":3302134,"avatar_url":"https://avatars.githubusercontent.com/u/3302134?v=3","gravatar_id":"","url":"https://api.github.com/users/nponiros","html_url":"https://github.com/nponiros","followers_url":"https://api.github.com/users/nponiros/followers","following_url":"https://api.github.com/users/nponiros/following{/other_user}","gists_url":"https://api.github.com/users/nponiros/gists{/gist_id}","starred_url":"https://api.github.com/users/nponiros/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nponiros/subscriptions","organizations_url":"https://api.github.com/users/nponiros/orgs","repos_url":"https://api.github.com/users/nponiros/repos","events_url":"https://api.github.com/users/nponiros/events{/privacy}","received_events_url":"https://api.github.com/users/nponiros/received_events","type":"User","site_admin":false},"labels":[{"id":82787777,"url":"https://api.github.com/repos/dfahlander/Dexie.js/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2016-12-30T15:25:18Z","updated_at":"2016-12-30T23:37:21Z","closed_at":null,"body":"In the typings for Observable sendMessage() and broadcastMessage() declare the `message` property as type `any`. As it seems when a message is consumed, any message which is not of type `object` is not passed to the 'message' handler as part of the argument. For some reason consumeMessage() deletes the `message` property and then adds it back to the message using Dexie.extend(). I don't why this is done. I would expect to receive the message as `message` property in the argument of the 'message' handler.\r\n\r\nSo the question is: are the typings wrong or should consumeMessage() be implemented differently? I also didn't find any documentation on the 'message' event, is it considered private?"},"comment":{"url":"https://api.github.com/repos/dfahlander/Dexie.js/issues/comments/269835214","html_url":"https://github.com/dfahlander/Dexie.js/issues/429#issuecomment-269835214","issue_url":"https://api.github.com/repos/dfahlander/Dexie.js/issues/429","id":269835214,"user":{"login":"dfahlander","id":6791329,"avatar_url":"https://avatars.githubusercontent.com/u/6791329?v=3","gravatar_id":"","url":"https://api.github.com/users/dfahlander","html_url":"https://github.com/dfahlander","followers_url":"https://api.github.com/users/dfahlander/followers","following_url":"https://api.github.com/users/dfahlander/following{/other_user}","gists_url":"https://api.github.com/users/dfahlander/gists{/gist_id}","starred_url":"https://api.github.com/users/dfahlander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dfahlander/subscriptions","organizations_url":"https://api.github.com/users/dfahlander/orgs","repos_url":"https://api.github.com/users/dfahlander/repos","events_url":"https://api.github.com/users/dfahlander/events{/privacy}","received_events_url":"https://api.github.com/users/dfahlander/received_events","type":"User","site_admin":false},"created_at":"2016-12-30T23:37:21Z","updated_at":"2016-12-30T23:37:21Z","body":"The reason to put 'any' in the d.ts was that the editor would complain if specifying an interface. Could have been done as with IPersistantContext and allow dynamic properties on the interface, but I was too sloppy for that. If changing the API to keep message as a property, the d.ts would be clearer and could define \"msg\" but keep \"message\" as 'any'. If we define it as Object, the user will have to cast it to access its properties. And generics is not useful here since on('message') is separate from sendMessage()/broadcastMessage().\r\n"}}
{"actor":{"display_login":"dfahlander"}}