{"action":"created","issue":{"url":"https://api.github.com/repos/zulip/zulip-mobile/issues/3654","repository_url":"https://api.github.com/repos/zulip/zulip-mobile","labels_url":"https://api.github.com/repos/zulip/zulip-mobile/issues/3654/labels{/name}","comments_url":"https://api.github.com/repos/zulip/zulip-mobile/issues/3654/comments","events_url":"https://api.github.com/repos/zulip/zulip-mobile/issues/3654/events","html_url":"https://github.com/zulip/zulip-mobile/issues/3654","id":508796157,"node_id":"MDU6SXNzdWU1MDg3OTYxNTc=","number":3654,"title":"PMs from new sources not immediately displayed in PMs list","user":{"login":"ray-kraesig","id":54861490,"node_id":"MDQ6VXNlcjU0ODYxNDkw","avatar_url":"https://avatars1.githubusercontent.com/u/54861490?v=4","gravatar_id":"","url":"https://api.github.com/users/ray-kraesig","html_url":"https://github.com/ray-kraesig","followers_url":"https://api.github.com/users/ray-kraesig/followers","following_url":"https://api.github.com/users/ray-kraesig/following{/other_user}","gists_url":"https://api.github.com/users/ray-kraesig/gists{/gist_id}","starred_url":"https://api.github.com/users/ray-kraesig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ray-kraesig/subscriptions","organizations_url":"https://api.github.com/users/ray-kraesig/orgs","repos_url":"https://api.github.com/users/ray-kraesig/repos","events_url":"https://api.github.com/users/ray-kraesig/events{/privacy}","received_events_url":"https://api.github.com/users/ray-kraesig/received_events","type":"User","site_admin":false},"labels":[{"id":1122438174,"node_id":"MDU6TGFiZWwxMTIyNDM4MTc0","url":"https://api.github.com/repos/zulip/zulip-mobile/labels/P1%20high-priority","name":"P1 high-priority","color":"ff9000","default":false,"description":""},{"id":1118791359,"node_id":"MDU6TGFiZWwxMTE4NzkxMzU5","url":"https://api.github.com/repos/zulip/zulip-mobile/labels/a-realtime","name":"a-realtime","color":"bfd4f2","default":false,"description":"Zulip's event system, event queues, staleness/liveness"}],"state":"open","locked":false,"assignee":{"login":"chrisbobbe","id":22248748,"node_id":"MDQ6VXNlcjIyMjQ4NzQ4","avatar_url":"https://avatars3.githubusercontent.com/u/22248748?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisbobbe","html_url":"https://github.com/chrisbobbe","followers_url":"https://api.github.com/users/chrisbobbe/followers","following_url":"https://api.github.com/users/chrisbobbe/following{/other_user}","gists_url":"https://api.github.com/users/chrisbobbe/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisbobbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisbobbe/subscriptions","organizations_url":"https://api.github.com/users/chrisbobbe/orgs","repos_url":"https://api.github.com/users/chrisbobbe/repos","events_url":"https://api.github.com/users/chrisbobbe/events{/privacy}","received_events_url":"https://api.github.com/users/chrisbobbe/received_events","type":"User","site_admin":false},"assignees":[{"login":"chrisbobbe","id":22248748,"node_id":"MDQ6VXNlcjIyMjQ4NzQ4","avatar_url":"https://avatars3.githubusercontent.com/u/22248748?v=4","gravatar_id":"","url":"https://api.github.com/users/chrisbobbe","html_url":"https://github.com/chrisbobbe","followers_url":"https://api.github.com/users/chrisbobbe/followers","following_url":"https://api.github.com/users/chrisbobbe/following{/other_user}","gists_url":"https://api.github.com/users/chrisbobbe/gists{/gist_id}","starred_url":"https://api.github.com/users/chrisbobbe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrisbobbe/subscriptions","organizations_url":"https://api.github.com/users/chrisbobbe/orgs","repos_url":"https://api.github.com/users/chrisbobbe/repos","events_url":"https://api.github.com/users/chrisbobbe/events{/privacy}","received_events_url":"https://api.github.com/users/chrisbobbe/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2019-10-18T01:02:34Z","updated_at":"2020-01-13T21:24:19Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"When a user receives a PM from a new source (_i.e._, one that had not previously sent them a PM), the center icon will correctly display a notification for a new message... but when tapped, that conversation-source does not appear in the PMs list; it remains unrefreshed.\r\n\r\n(Force-stopping and reentering the app will also force a refresh.)"},"comment":{"url":"https://api.github.com/repos/zulip/zulip-mobile/issues/comments/573877851","html_url":"https://github.com/zulip/zulip-mobile/issues/3654#issuecomment-573877851","issue_url":"https://api.github.com/repos/zulip/zulip-mobile/issues/3654","id":573877851,"node_id":"MDEyOklzc3VlQ29tbWVudDU3Mzg3Nzg1MQ==","user":{"login":"gnprice","id":28173,"node_id":"MDQ6VXNlcjI4MTcz","avatar_url":"https://avatars1.githubusercontent.com/u/28173?v=4","gravatar_id":"","url":"https://api.github.com/users/gnprice","html_url":"https://github.com/gnprice","followers_url":"https://api.github.com/users/gnprice/followers","following_url":"https://api.github.com/users/gnprice/following{/other_user}","gists_url":"https://api.github.com/users/gnprice/gists{/gist_id}","starred_url":"https://api.github.com/users/gnprice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gnprice/subscriptions","organizations_url":"https://api.github.com/users/gnprice/orgs","repos_url":"https://api.github.com/users/gnprice/repos","events_url":"https://api.github.com/users/gnprice/events{/privacy}","received_events_url":"https://api.github.com/users/gnprice/received_events","type":"User","site_admin":false},"created_at":"2020-01-13T21:24:19Z","updated_at":"2020-01-13T21:24:19Z","author_association":"MEMBER","body":"Thanks @chrisbobbe for the investigation and that writeup!\r\n\r\n> There's an initial fetch specifically of private messages that should be getting all of the most recent ones, [... b]ut the response to that /messages call has false for found_newest, so perhaps there's a server-side bug, or something wrong with the /messages request.\r\n\r\nYeah, this sounds like a point where something's already gone wrong, then.\r\n\r\nThe code that makes that request (fetchPrivateMessages which is dispatched during doInitialFetch in src/message/fetchActions.js, as you said) looks like this:\r\n```js\r\nconst fetchPrivateMessages = () => async (dispatch: Dispatch, getState: GetState) => {\r\n  const auth = getAuth(getState());\r\n  const { messages, found_newest, found_oldest } = await tryUntilSuccessful(() =>\r\n    api.getMessages(auth, ALL_PRIVATE_NARROW, LAST_MESSAGE_ANCHOR, 100, 0),\r\n```\r\n\r\nwhere \r\n```js\r\nexport const LAST_MESSAGE_ANCHOR = Number.MAX_SAFE_INTEGER;\r\n```\r\n\r\nand that `api.getMessages` binding looks like\r\n```js\r\nexport default async (\r\n  auth: Auth,\r\n  narrow: Narrow,\r\n  anchor: number,\r\n  numBefore: number,\r\n  numAfter: number,\r\n  useFirstUnread: boolean = false,\r\n): Promise<ApiResponseMessages> => {\r\n  const response: ServerApiResponseMessages = await apiGet(auth, 'messages', {\r\n    narrow: JSON.stringify(narrow),\r\n    anchor,\r\n    num_before: numBefore,\r\n    num_after: numAfter,\r\n    apply_markdown: true,\r\n    use_first_unread_anchor: useFirstUnread,\r\n  });\r\n```\r\n\r\nIt sure looks to me like that *ought* to result in `found_newest` being true -- we're asking specifically for the very latest messages. Perhaps there's a subtlety in the API here, or perhaps just a server-side bug. @timabbott , do you have any ideas on why a request like this would produce `found_newest` false?\r\n\r\n"}}
{"actor":{"display_login":"gnprice"}}