{"action":"created","issue":{"url":"https://api.github.com/repos/tdlib/td/issues/226","repository_url":"https://api.github.com/repos/tdlib/td","labels_url":"https://api.github.com/repos/tdlib/td/issues/226/labels{/name}","comments_url":"https://api.github.com/repos/tdlib/td/issues/226/comments","events_url":"https://api.github.com/repos/tdlib/td/issues/226/events","html_url":"https://github.com/tdlib/td/issues/226","id":321454338,"number":226,"title":"getChatAdministrators returns incorrect data","user":{"login":"kossnocorp","id":52201,"avatar_url":"https://avatars1.githubusercontent.com/u/52201?v=4","gravatar_id":"","url":"https://api.github.com/users/kossnocorp","html_url":"https://github.com/kossnocorp","followers_url":"https://api.github.com/users/kossnocorp/followers","following_url":"https://api.github.com/users/kossnocorp/following{/other_user}","gists_url":"https://api.github.com/users/kossnocorp/gists{/gist_id}","starred_url":"https://api.github.com/users/kossnocorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kossnocorp/subscriptions","organizations_url":"https://api.github.com/users/kossnocorp/orgs","repos_url":"https://api.github.com/users/kossnocorp/repos","events_url":"https://api.github.com/users/kossnocorp/events{/privacy}","received_events_url":"https://api.github.com/users/kossnocorp/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-05-09T07:05:30Z","updated_at":"2018-05-09T13:07:35Z","closed_at":null,"author_association":"NONE","body":"I was testing my app adding and removing a user from administrators of my channel. After few iterations, I ended up with `getChatAdministrators` returning incorrect data:\r\n\r\n![cloudapp annotation 2018-05-09 at 11 00 21 am png](https://user-images.githubusercontent.com/52201/39800298-50debe48-5378-11e8-801b-0f4106f368cc.png)\r\n\r\nIt's either TDLib cache problem or an issue on Telegram side. I'll be glad to help you to debug the issue, just tell me what to do. You can also contact me directly at Telegram: http://t.me/kossnocorp"},"comment":{"url":"https://api.github.com/repos/tdlib/td/issues/comments/387732206","html_url":"https://github.com/tdlib/td/issues/226#issuecomment-387732206","issue_url":"https://api.github.com/repos/tdlib/td/issues/226","id":387732206,"user":{"login":"kossnocorp","id":52201,"avatar_url":"https://avatars1.githubusercontent.com/u/52201?v=4","gravatar_id":"","url":"https://api.github.com/users/kossnocorp","html_url":"https://github.com/kossnocorp","followers_url":"https://api.github.com/users/kossnocorp/followers","following_url":"https://api.github.com/users/kossnocorp/following{/other_user}","gists_url":"https://api.github.com/users/kossnocorp/gists{/gist_id}","starred_url":"https://api.github.com/users/kossnocorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kossnocorp/subscriptions","organizations_url":"https://api.github.com/users/kossnocorp/orgs","repos_url":"https://api.github.com/users/kossnocorp/repos","events_url":"https://api.github.com/users/kossnocorp/events{/privacy}","received_events_url":"https://api.github.com/users/kossnocorp/received_events","type":"User","site_admin":false},"created_at":"2018-05-09T13:07:35Z","updated_at":"2018-05-09T13:07:35Z","author_association":"NONE","body":"> Request to getChatAdministrators always returns result from a cache if possible, updating the cache in background. There is no update sent when cache value changes, because there is no way to make it reliable: client doesn't receive any update from the server when list of administrators is changed. So to receive actual list of administrators you need to repeat the call to getChatAdministrators in 1 second. \r\n\r\nThe thing is that TDLib is stuck in this state. I didn't try to add/remove the user from admins again in case if it could help to debug the issue.\r\n\r\n> Or better use getSupergroupMembers with filter supergroupMembersFilterAdministrators for supergorups (currently, it will always send network request) or getBasicGroupFullInfo for basic groups.\r\n\r\nThank you for suggesting, I think I'll go with `getSupergroupMembers` as it doesn't rely on the cache.\r\n"}}
{"actor":{"display_login":"kossnocorp"}}