{"action":"created","issue":{"url":"https://api.github.com/repos/zulip/zulip/issues/8577","repository_url":"https://api.github.com/repos/zulip/zulip","labels_url":"https://api.github.com/repos/zulip/zulip/issues/8577/labels{/name}","comments_url":"https://api.github.com/repos/zulip/zulip/issues/8577/comments","events_url":"https://api.github.com/repos/zulip/zulip/issues/8577/events","html_url":"https://github.com/zulip/zulip/issues/8577","id":302106580,"number":8577,"title":"Exception with can_admin in real-time sync of bot data","user":{"login":"timabbott","id":2746074,"avatar_url":"https://avatars0.githubusercontent.com/u/2746074?v=4","gravatar_id":"","url":"https://api.github.com/users/timabbott","html_url":"https://github.com/timabbott","followers_url":"https://api.github.com/users/timabbott/followers","following_url":"https://api.github.com/users/timabbott/following{/other_user}","gists_url":"https://api.github.com/users/timabbott/gists{/gist_id}","starred_url":"https://api.github.com/users/timabbott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timabbott/subscriptions","organizations_url":"https://api.github.com/users/timabbott/orgs","repos_url":"https://api.github.com/users/timabbott/repos","events_url":"https://api.github.com/users/timabbott/events{/privacy}","received_events_url":"https://api.github.com/users/timabbott/received_events","type":"User","site_admin":false},"labels":[{"id":517007663,"url":"https://api.github.com/repos/zulip/zulip/labels/area:%20bots","name":"area: bots","color":"bfd4f2","default":false},{"id":461204569,"url":"https://api.github.com/repos/zulip/zulip/labels/area:%20settings%20(user)","name":"area: settings (user)","color":"bfd4f2","default":false},{"id":265216829,"url":"https://api.github.com/repos/zulip/zulip/labels/bug","name":"bug","color":"fc2929","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-03-04T18:01:53Z","updated_at":"2018-03-05T19:14:34Z","closed_at":null,"author_association":"OWNER","body":"I saw this in production; don't have a clear reproducer.  I think it's worth something trying to play around with creating/editing bots in one browser with another browser open while looking for it, though.  See #8576 as a sidenote.  \r\n\r\nMy guess is that when a user is changed to be the admin of a bot (and thus the bot enters that user's bot data), that user doesn't get an event telling the client that the bot exists before they get an event telling them about the bot's new owner.  Or something like that.\r\n\r\n```\r\nMessage:\r\nFailed to process an event\r\nCannot set property 'can_admin' of undefined\r\n\r\nStacktrace:\r\nTypeError: Cannot set property 'can_admin' of undefined\r\n    at c (static/min/app.9ddad22036f3.js:2320:610)\r\n       = static/js/bot_data.js line 16 column 9\r\n\r\n    at Object.g.update (static/min/app.9ddad22036f3.js:2321:160)\r\n       = static/js/bot_data.js line 45 column 9\r\n\r\n    at Object.dispatch_normal_event (static/min/app.9ddad22036f3.js:2122:468)\r\n       = static/js/server_events_dispatch.js line 124 column 13\r\n\r\n    at static/min/app.9ddad22036f3.js:2111:103\r\n       = static/js/server_events.js line 76 column 20\r\n\r\n    at Function.q.each.q.forEach (static/webpack-bundles/common-ae9d0dc177dbe7eea9c3.c3a91c4a19f2.js:179:265399)\r\n       = webpack:////srv/zulip-npm-cache/b32afb2e7b04fe936fa9afa9bbf4a59aedde022f/~/underscore/underscore.js?b4bb line 153 column 1\r\n\r\n    at g (static/min/app.9ddad22036f3.js:2110:657)\r\n       = static/js/server_events.js line 80 column 5\r\n\r\n    at success (static/min/app.9ddad22036f3.js:2113:424)\r\n       = static/js/server_events.js line 174 column 17\r\n```\r\n\r\n@roberthoenig FYI since you've done some recent work in this area."},"comment":{"url":"https://api.github.com/repos/zulip/zulip/issues/comments/370530241","html_url":"https://github.com/zulip/zulip/issues/8577#issuecomment-370530241","issue_url":"https://api.github.com/repos/zulip/zulip/issues/8577","id":370530241,"user":{"login":"shubham-padia","id":13910561,"avatar_url":"https://avatars1.githubusercontent.com/u/13910561?v=4","gravatar_id":"","url":"https://api.github.com/users/shubham-padia","html_url":"https://github.com/shubham-padia","followers_url":"https://api.github.com/users/shubham-padia/followers","following_url":"https://api.github.com/users/shubham-padia/following{/other_user}","gists_url":"https://api.github.com/users/shubham-padia/gists{/gist_id}","starred_url":"https://api.github.com/users/shubham-padia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shubham-padia/subscriptions","organizations_url":"https://api.github.com/users/shubham-padia/orgs","repos_url":"https://api.github.com/users/shubham-padia/repos","events_url":"https://api.github.com/users/shubham-padia/events{/privacy}","received_events_url":"https://api.github.com/users/shubham-padia/received_events","type":"User","site_admin":false},"created_at":"2018-03-05T19:14:33Z","updated_at":"2018-03-05T19:14:33Z","author_association":"COLLABORATOR","body":"@zulipbot claim. \r\nI am able to reproduce this and found that the issue matches the story described above."}}
{"actor":{"display_login":"shubham-padia"}}