Repository navigation
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
fluxis
force-pushed
the
feat/v2-invitation-limits-guarded-create
branch
from
October 8, 2026 18:08
04f338c to
8403278
Compare
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
The collection and section removals are already in main. Remove their stale approval entries as required by the native contract policy; their approval provenance remains in git history. The invitation contract remains additive.
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
Related issue: #135
Validation tasks: changes #1196 C2; changes #1197 C1/C2
Invitations currently create accounts with the default profile limit until an administrator edits the account after acceptance. Creating another invitation for an address also replaces its pending link. This adds v2 options to bind the initial account limit during acceptance and to refuse an existing pending invitation when the caller asks to preserve it.
Approach
An optional positive
max_profilesis stored with the invitation and applied in the same transaction as the account, optional default profile and claim. Omission keeps the default of 5. Resend copies the limit from its locked source. Migration rollback refuses to discard an explicit cap from an invitation that can still be claimed.Optional
replace_existing: falseuses transactional address admission and the pending-invitation unique index to return409without changing another invitation or sending mail. Omission or true keeps ordinary replacement. Exact-source resend remains an explicit replacement and refuses stale source IDs. Both additions have capability fields.The public claim request and frozen v1 invitation DTOs stay unchanged. Apple and Android have no administrator invitation consumers to update; the existing account profile-limit field continues to carry the claimed limit. Jellyfin has no native administrator invitation surface. The manual follow-up documents the new native invitation options after merge.
Validation
The invitation implementation was qualified against native main
6bdbb7d12f5f89cf17435ceec0c60a7cf70d06a6at84032788c216495f7ab7796a072a24b4a549f1d0; the implementation patch is unchanged by the rebase. Fresh focused invitation tests, actual-router OpenAPI generation, router fixture/schema checks, web type freshness, TypeScript project build, scoped ESLint/Prettier, and all 17 affected web tests passed. All 11 added PostgreSQL contracts passed through the strict runner without skips in a fresh isolated environment. Removing initial-cap or guarded-create forwarding produced failures; restoring each passed. The compiled migration runner refused rollback while a capped invitation remained, preserving the exact invitation and ledger, then completed Down/Up after revocation. Exact database, container, volume, and outer test-daemon cleanup passed.Final head
321f1e4142cd5b01b446f261e09364ac4192cd51adds only the removal of 13 already-merged approval entries required by the native contract policy; their provenance remains in git history. With that exact staged change frozen, the production semantic gate and focused contract-policy/CLI tests passed. Restoring the stale entries reproduced the failure; removing them again passed. The gate reports 10 additive invitation changes and no breaking changes. Exact private builder and outer daemon cleanup passed. Browser captures retain their original build labels. Full local suites were not run.Evidence
Desktop and phone captures show the native web administrator Profiles card with the same synthetic profile, Alex. The legacy request omits the cap and displays “1 of 5 allowed”; the new request binds 2 and displays “1 of 2 allowed”. Both use the actual compiled server and native PostgreSQL/auth/session stores through the pinned frontend. The claimed accounts were deleted and canonical reads returned 404. No new invitation editor control is added.
Evidence publication pending. Surface/build: invitation-only frozen source; commit
04f338c0df829b85e728f54f9dc30c91db99465c.Risks
The cap column must be migrated before serving this contract. Rollback intentionally refuses while an unexpired, unaccepted, unrevoked explicitly capped invitation remains. Accepted account limits remain stored independently. Delivery and login failures after commit retain their existing non-retryable outcome semantics. Open PR #1801 changes profile-limit inheritance; whichever change lands second needs a rebase and an account-provisioning/default-policy review.
Checklist
AI Disclosure
gpt-6.1-sol; exact runtime SKU is not separately exposed