{"action":"created","issue":{"url":"https://api.github.com/repos/myano/jenni/issues/184","labels_url":"https://api.github.com/repos/myano/jenni/issues/184/labels{/name}","comments_url":"https://api.github.com/repos/myano/jenni/issues/184/comments","events_url":"https://api.github.com/repos/myano/jenni/issues/184/events","html_url":"https://github.com/myano/jenni/pull/184","id":84595901,"number":184,"title":"Fix setattr on wrapped class","user":{"login":"solidgoldbomb","id":71638,"avatar_url":"https://avatars.githubusercontent.com/u/71638?v=3","gravatar_id":"","url":"https://api.github.com/users/solidgoldbomb","html_url":"https://github.com/solidgoldbomb","followers_url":"https://api.github.com/users/solidgoldbomb/followers","following_url":"https://api.github.com/users/solidgoldbomb/following{/other_user}","gists_url":"https://api.github.com/users/solidgoldbomb/gists{/gist_id}","starred_url":"https://api.github.com/users/solidgoldbomb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidgoldbomb/subscriptions","organizations_url":"https://api.github.com/users/solidgoldbomb/orgs","repos_url":"https://api.github.com/users/solidgoldbomb/repos","events_url":"https://api.github.com/users/solidgoldbomb/events{/privacy}","received_events_url":"https://api.github.com/users/solidgoldbomb/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-06-03T14:33:55Z","updated_at":"2015-06-15T03:22:12Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/myano/jenni/pulls/184","html_url":"https://github.com/myano/jenni/pull/184","diff_url":"https://github.com/myano/jenni/pull/184.diff","patch_url":"https://github.com/myano/jenni/pull/184.patch"},"body":"Some modules are setting/updating attributes expecting them to be globally visible but because the modules only see a wrapped version of the 'jenni' object, all of these updates are lost immediately after the call to the module's method.\r\n\r\nSee: usage of is_authenticated and is_connected in startup.py and sasl.py\r\n\r\nThis is directly visible by watching the log when SASL auth succeeds and noting that startup.py still initiates the IDENTIFY with nickserv. This is due to startup.py seeing is_authenticated as False rather than the (lost in wrapped version) True set by sasl.py.\r\n\r\nSpecifically, the 903 handling in sasl.py sets jenni.is_authenticated = True. That cannot ever be seen outside of this call since it is only set in the wrapped class, not the \"real\" jenni instance.\r\n\r\nThis patch set does the following:\r\n* Hide the ```bot``` (wrapped class) as ```_bot```\r\n* Allow getattr on ```bot``` to continue to work by passing it to ```_bot``` **but** also dump a deprecation warning with traceback to the console\r\n* Fix the setattr on the wrapped jenni class so that setting an attribute on ```jenni.foo``` modifies the top-level jenni instance and is preserved across calls to module handlers\r\n* Remove all usage of ```jenni.bot.foo``` and replace with direct access to ```jenni.foo```\r\n\r\nThis should fix the auth related bug without breaking any existing in-tree (or out-of-tree) usage of the wrapped class.  I've tested this, but don't have all modules active on my bot.  Could use some testing on a full version of jenni.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/myano/jenni/issues/comments/111909658","html_url":"https://github.com/myano/jenni/pull/184#issuecomment-111909658","issue_url":"https://api.github.com/repos/myano/jenni/issues/184","id":111909658,"user":{"login":"solidgoldbomb","id":71638,"avatar_url":"https://avatars.githubusercontent.com/u/71638?v=3","gravatar_id":"","url":"https://api.github.com/users/solidgoldbomb","html_url":"https://github.com/solidgoldbomb","followers_url":"https://api.github.com/users/solidgoldbomb/followers","following_url":"https://api.github.com/users/solidgoldbomb/following{/other_user}","gists_url":"https://api.github.com/users/solidgoldbomb/gists{/gist_id}","starred_url":"https://api.github.com/users/solidgoldbomb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solidgoldbomb/subscriptions","organizations_url":"https://api.github.com/users/solidgoldbomb/orgs","repos_url":"https://api.github.com/users/solidgoldbomb/repos","events_url":"https://api.github.com/users/solidgoldbomb/events{/privacy}","received_events_url":"https://api.github.com/users/solidgoldbomb/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T03:22:12Z","updated_at":"2015-06-15T03:22:12Z","body":"@kaneda: Did you have time to try this branch?"}}