{"action":"created","issue":{"url":"https://api.github.com/repos/skoczen/will/issues/157","labels_url":"https://api.github.com/repos/skoczen/will/issues/157/labels{/name}","comments_url":"https://api.github.com/repos/skoczen/will/issues/157/comments","events_url":"https://api.github.com/repos/skoczen/will/issues/157/events","html_url":"https://github.com/skoczen/will/issues/157","id":83610211,"number":157,"title":"internal_roster can become a stale cache; no way to reset","user":{"login":"jhermes","id":310982,"avatar_url":"https://avatars.githubusercontent.com/u/310982?v=3","gravatar_id":"","url":"https://api.github.com/users/jhermes","html_url":"https://github.com/jhermes","followers_url":"https://api.github.com/users/jhermes/followers","following_url":"https://api.github.com/users/jhermes/following{/other_user}","gists_url":"https://api.github.com/users/jhermes/gists{/gist_id}","starred_url":"https://api.github.com/users/jhermes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhermes/subscriptions","organizations_url":"https://api.github.com/users/jhermes/orgs","repos_url":"https://api.github.com/users/jhermes/repos","events_url":"https://api.github.com/users/jhermes/events{/privacy}","received_events_url":"https://api.github.com/users/jhermes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-06-01T17:19:04Z","updated_at":"2015-06-03T01:09:58Z","closed_at":null,"body":"The redis entry \"will_roster\" is persisted and holds a mapping of hipchat ids to often-accessed user data. It's initialized first in update_will_roster_and_rooms() and the user data within is accessed very many times.\r\n\r\nEach subsequent update_will_roster_and_rooms() is additive and will not overwrite any user data that already exists (i.e. 'if user is not \"\": ...\" and \"if not hasattr nick: ...\").\r\n\r\n**When a user changes their name/nick/mention_name, there is no mechanism to push that change into the \"will_roster\" cache**, so their user data (from will's POV) will continue to be their old user data.\r\n\r\nThis certainly bit me writing a plugin that **expected message.sender.nicks to accurately represent their current nick, not the first nick that the will plugin ever saw them use**.\r\n\r\nIn order of the strength of changes:\r\n- Why is this cache persisted to disk and not just held in memory?\r\n- Assuming it's better/easier to leave it persisted, can it clear the cache on startup? (self.save(\"will_roster\", {}) during boot path somewhere.)\r\n- Assuming that hack is too ugly, can update_will_roster...() check for discrepancies in the cache on each invocation instead of giving up when it checks for existence?\r\n- Assuming this behaviour is intentional or otherwise too ugly to fix, can a (\"SERIOUSLY!...\") admin-y access be added that drops this cache and forces it to be regenerated?\r\n\r\nI have a temporary workaround in the form of hand-editing the \"will_roster\" on any nick changes (carefully, dotting i's, crossing t's), though it's less than desirable."},"comment":{"url":"https://api.github.com/repos/skoczen/will/issues/comments/108148511","html_url":"https://github.com/skoczen/will/issues/157#issuecomment-108148511","issue_url":"https://api.github.com/repos/skoczen/will/issues/157","id":108148511,"user":{"login":"skoczen","id":200635,"avatar_url":"https://avatars.githubusercontent.com/u/200635?v=3","gravatar_id":"","url":"https://api.github.com/users/skoczen","html_url":"https://github.com/skoczen","followers_url":"https://api.github.com/users/skoczen/followers","following_url":"https://api.github.com/users/skoczen/following{/other_user}","gists_url":"https://api.github.com/users/skoczen/gists{/gist_id}","starred_url":"https://api.github.com/users/skoczen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skoczen/subscriptions","organizations_url":"https://api.github.com/users/skoczen/orgs","repos_url":"https://api.github.com/users/skoczen/repos","events_url":"https://api.github.com/users/skoczen/events{/privacy}","received_events_url":"https://api.github.com/users/skoczen/received_events","type":"User","site_admin":false},"created_at":"2015-06-03T01:09:58Z","updated_at":"2015-06-03T01:09:58Z","body":"Cool.  Polling should be simple - in fact, you could actually probably just write a will plugin using `periodic` that does it.\r\n\r\nAs for the broadcasts, doesn't look like it at first glance via the [api docs](https://www.hipchat.com/docs/apiv2/webhooks). \r\n\r\nWant to give a plugin a shot?"}}