feat(sharing): make share-all / batch-share caps configurable#23
Merged
Conversation
The 5000 (share-all, share-all-to-user) and 500 (batch-share, org/publish) per-call caps were hardcoded hard rejects. Both paths already process via bounded-concurrency streams (buffer_unordered(10)), and share-all loads all candidates via list_all_active() regardless of the cap -- so the caps are arbitrary count limits, not load protection. Make them configurable: OMEM_SHARE_ALL_MAX (default 5000) and OMEM_BATCH_SHARE_MAX (default 500); 0 = unlimited. Defaults equal the previous hardcoded values, so there is no default behavior change -- operators can raise or disable the caps for larger spaces. Docs: .env.example + docs/SHARING.md updated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Merged — thanks! Clean and uncontroversial. 👍 |
This was referenced May 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
share-all/share-all-to-usercap at 5000 memories per call andbatch-share/org-publishat 500, as hardcoded hard rejects. For larger spaces you must split into multiple calls.Finding
Both paths already process via bounded-concurrency streams (
buffer_unordered(10)), andshare-allloads all candidates vialist_all_active()regardless of the cap. So the caps are arbitrary count limits, not load protection.Change
Make them configurable (matching the existing
config.rsenv-var convention):OMEM_SHARE_ALL_MAX(default 5000) — share-all + share-all-to-userOMEM_BATCH_SHARE_MAX(default 500) — batch-share + org/publish0= unlimited.No default behavior change — defaults equal the previous hardcoded values; operators raise/disable as needed. Concurrency stays bounded by
buffer_unordered(10).Docs
.env.example+docs/SHARING.md(the two limitation entries now read "configurable").Tests
config_defaults_are_validasserts the new defaults; full suite green (388 passed); fmt + clippy clean (no new warnings).