Page through every channel membership #401
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "postvak-paginate-channel-memberships"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The Postvak came up empty on a production account while Mattermost showed an unread channel.
GET /users/me/channel_memberspages at 60 without an explicitper_page, and the client read one page. A channel whose membership never arrives is skipped inmm_unread.py(if member is None: continue), so the rows quietly disappear and the endpoint answers{"items":[]}with a 200.Measured on that account: 458 memberships, 60 fetched, and the only non-muted unread channel sat outside them.
The walk asks for 200 per page and stops on a short page. It also stops on a page that adds no new ids, because
/users/me/channelsignores paging and serves the full list for every page - a short-page check alone never terminates against that. A 50-page cap bounds it either way.Tests
Three, all in
test_mattermost_unread_client.py: the walk collects 250 rows across pages (fails before this change withfirst extra item: 'c60'), it terminates against an endpoint that ignores paging, and it stops at the cap. The existing URL assertion moves to the paged URL.Found while debugging, not in this PR
resolve_crt_enabledreads the collapsed-reply-threads preference from/preferences/display/collapsed_reply_threads. Mattermost serves it at/preferences/display_settings/name/collapsed_reply_threads: wrong category, and the/name/segment is missing. The 404 that comes back is read as "not set", which underCollapsedThreads: default_onresolves to on - which happens to be the right answer today, so nothing shows. Turn CRT off and the Postvak empties again.get_user_preferenceonly translates 404, so fixing the URL alone turns the silent default into a 502.6daa27a0003585b0220c