Warn when the membership walk stops at its page cap #427
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "mm-membership-cap-warning"
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?
Closes #402. When
list_my_channel_membershipsreaches its cap of 50 pages of 200, it now asks for one page more (page 50) and logsmm_memberships_truncated(withpagesandmemberships) only if that page holds memberships it has not seen yet. The rows of that page stay out of the result, so the cap still bounds what is returned. A walk that ends exactly on 10,000 memberships, or a server that serves repeats past the cap, stays silent; a short page or a page with nothing new stops the walk before the cap and never makes the extra request. The page fetch moved into_membership_pageso the extra request shares the 401/4xx handling.Tests: the cap test asserts the warning and 51 requests; a parametrized test covers ending exactly on the cap (empty page and only-repeats page after it); a normal multi-page walk logs nothing.
mattermost.pyhad no logger yet; it gets a structlog one, like most modules. The line carriesrequest_idthrough the middleware, which links it to the request line with the pseudonymous user id.No CHANGELOG entry: an ops log line, nothing a user sees.
f880a0e7c722f8f7edef22f8f7edef78b745c63b