{"action":"created","issue":{"url":"https://api.github.com/repos/youfou/wxpy/issues/84","repository_url":"https://api.github.com/repos/youfou/wxpy","labels_url":"https://api.github.com/repos/youfou/wxpy/issues/84/labels{/name}","comments_url":"https://api.github.com/repos/youfou/wxpy/issues/84/comments","events_url":"https://api.github.com/repos/youfou/wxpy/issues/84/events","html_url":"https://github.com/youfou/wxpy/issues/84","id":235905435,"number":84,"title":"重构 wxpy.Bot.core","user":{"login":"youfou","id":16631068,"avatar_url":"https://avatars3.githubusercontent.com/u/16631068?v=3","gravatar_id":"","url":"https://api.github.com/users/youfou","html_url":"https://github.com/youfou","followers_url":"https://api.github.com/users/youfou/followers","following_url":"https://api.github.com/users/youfou/following{/other_user}","gists_url":"https://api.github.com/users/youfou/gists{/gist_id}","starred_url":"https://api.github.com/users/youfou/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/youfou/subscriptions","organizations_url":"https://api.github.com/users/youfou/orgs","repos_url":"https://api.github.com/users/youfou/repos","events_url":"https://api.github.com/users/youfou/events{/privacy}","received_events_url":"https://api.github.com/users/youfou/received_events","type":"User","site_admin":false},"labels":[{"id":543843006,"url":"https://api.github.com/repos/youfou/wxpy/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-06-14T14:47:59Z","updated_at":"2017-06-16T15:23:20Z","closed_at":null,"body":"## 背景\r\n\r\n1. wxpy 没有使用 itchat 的最新版本，是因为升级后 (可能因为兼容性问题) 会出现内存泄露\r\n2. 但近期在 itchat 1.2.32 (目前依赖的版本) 中，陆续发现了一些难以在外部修复的问题\r\n3. 最后综合未来灵活性的考虑，决定重构 wxpy.Bot.core，解除对 itchat 的依赖\r\n4. 预计重构后还将带来性能上的提升 (专门针对 wxpy 的需求进行实现)\r\n\r\n## 方法\r\n\r\n* 参照 itchat.Core 接口进行重构 (必要调整除外)，减少对现有代码的改动，避免引入新的 bug\r\n* Web 微信协议部分，会主要参考 itchat 现有的实现，减少重新抓包研究所需的精力\r\n* 在重构过程中关注并实现以下任务点\r\n\r\n## 任务\r\n\r\n- [ ]  改进 synccheck 和 webwxsync 请求的重试机制 (尽可能的增加宽容度)，加强在线稳定性\r\n- [ ]  排查上述两个请求的各参数细节，解决短时间大量消息时的漏收问题\r\n- [ ]  内部数据更多考虑使用以 user_name 为 key 的 dict 进行保存，提高查找性能\r\n- [ ]  减少内存占用\r\n- [ ]  支持更新部分好友或部分群友的详细信息 (性别、地区、签名)\r\n- [ ]  合并 Bot 的所有 callback，参数改为 bot, status, data\r\n- [ ]  改用 pyqrcode 内置的终端打印方法，提升环境兼容性 (无需设定宽度)\r\n- [ ]  初始化 Bot 时支持设定网络代理\r\n- [ ]  支持获取文件类消息发送成功后的 media_id\r\n- [ ]  将发送表情与发送图片的接口分离 (原先是发送图片为 .gif 自动当做表情发送)\r\n\r\n\r\n暂时考虑如上，希望了解下大家的看法，请在下方评论 ^^"},"comment":{"url":"https://api.github.com/repos/youfou/wxpy/issues/comments/309055583","html_url":"https://github.com/youfou/wxpy/issues/84#issuecomment-309055583","issue_url":"https://api.github.com/repos/youfou/wxpy/issues/84","id":309055583,"user":{"login":"kadaliao","id":7401626,"avatar_url":"https://avatars2.githubusercontent.com/u/7401626?v=3","gravatar_id":"","url":"https://api.github.com/users/kadaliao","html_url":"https://github.com/kadaliao","followers_url":"https://api.github.com/users/kadaliao/followers","following_url":"https://api.github.com/users/kadaliao/following{/other_user}","gists_url":"https://api.github.com/users/kadaliao/gists{/gist_id}","starred_url":"https://api.github.com/users/kadaliao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kadaliao/subscriptions","organizations_url":"https://api.github.com/users/kadaliao/orgs","repos_url":"https://api.github.com/users/kadaliao/repos","events_url":"https://api.github.com/users/kadaliao/events{/privacy}","received_events_url":"https://api.github.com/users/kadaliao/received_events","type":"User","site_admin":false},"created_at":"2017-06-16T15:23:20Z","updated_at":"2017-06-16T15:23:20Z","body":"👍"}}
{"actor":{"display_login":"kadaliao"}}