Repository navigation
fix: pre-release review P2 ride-along (slug 404 fold, txn guards, error split, config/rules) - #246
Merged
Merged
Conversation
- Org-slug existence oracle closed: the four caller-membership gates on
/api/me/organizations/{slug}/* (member list, member remove,
consent-request file, consent-request withdraw) answered 403
"not a member" for an existent-but-foreign org vs 404 for a
nonexistent one — any authenticated user could enumerate org slugs.
Now folded to the same 404 shape (#229/#223 discipline, matching
ApplicationService's own uniform 404). Role gates for actual members
(403 owner-or-admin) are unchanged — members legitimately know the
org exists. FileGuards test updated to the folded expectation.
- Transaction exactly-once guards: OrgConsentRepository::saveConsent and
OrgSuccessionRepository::effectSuccession now funnel every inline
failure path and the COMMIT callback through an invokeOnce wrapper
(saveTokenPair's real-incident hardening pattern) instead of relying
solely on "a rolled-back transaction never fires its commit callback".
- OrgConsentRequestRepository: new three-state findPendingEx/findByIdEx
(dbOk/found/row) — decision endpoints no longer render infrastructure
failures as business 404/409 (#230 Error-vs-NoRow policy). The re-file,
approve and reject paths answer DB_QUERY_ERROR on lookup failure.
- transfer-ownership openapi: documented 409 (target left mid-transfer)
and 500 (demotion failure; retry-safe) responses; SDK regenerated;
api-diff additive baseline ratified (Ex overloads).
- open_platform config blocks completed: max_pending_invitations_per_org added to all four configs (the env-override channel for the M6 bound was dead — overrides only land on existing paths), and config.bench gained the full fail-closed block it was missing entirely. - db-operations.md: the user-ratified seventh raw-SQL exemption (advisory- lock concurrency primitives, AdvisoryLock.cc) is now recorded — the rule text and the code had drifted. - OrganizationsPage: post-mutation refresh uses a direct refreshMembers (no close-then-reopen flicker, invite input preserved); nominating a successor with a non-numeric user ID now surfaces a validation message instead of a silent no-op; the consents-panel catch mirrors the success path's org-switch race guard. New i18n key in en + zh-CN.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
P2 ride-along batch from the comprehensive v1.3.2..master pre-release review — the cheap, high-value P2s that should ship with v1.4.0 (follows #245, the P0/P1 batch). Leftover P2s are being registered as tracking issues.
Changes
Backend hardening
/api/me/organizations/{slug}/*(member list, member remove, consent-request file, consent-request withdraw) answered 403 "not a member" for an existent-but-foreign org vs 404 for a nonexistent one; any authenticated user could enumerate which org slugs exist. Now folded into the same 404 shape (the Organization slug enumerable via open-platform create/transfer error shapes #229/Client provenance enumeration + owner_name on the consent redirect URL #223 discipline ApplicationService already applies). Role gates for actual members are unchanged (403) — a member legitimately knows the org exists. ⚠ Behavior change: non-member calls that previously returned 403 now return 404 (FileGuards test updated; no frontend/SDK code branches on the old 403 for these endpoints).OrgConsentRepository::saveConsentandOrgSuccessionRepository::effectSuccessionfunnel every inline failure path and the COMMIT callback through aninvokeOncewrapper (thesaveTokenPairreal-incident hardening pattern) instead of resting solely on "a rolled-back transaction never fires its commit callback".findPendingEx/findByIdEx(dbOk/found/row); re-file/approve/reject now answerDB_QUERY_ERROR(5xx) on lookup failure instead of masquerading as business 404/409 (loadOwnerRow normalizes DB failures to 'no owners row' on the application-management surface #230 Error-vs-NoRow policy). Old two-state methods kept (documented as folding).Config / docs / frontend
max_pending_invitations_per_orgadded to all four configs (the env-override channel for that bound was dead: overrides only land on existing paths);config.bench.jsongains the full fail-closed block it lacked entirely.AdvisoryLock.cc) recorded in.claude/rules/db-operations.md; rule text and code had drifted.refreshMembers(no close/reopen flicker; invite input preserved); non-numeric successor user ID surfaces a validation message instead of a silent no-op (new i18n key en+zh); the consents-panel error path mirrors the success path's org-switch race guard.Verification
fulla-server/fulla-testsRelease build green; 9 targeted tests pass (consent-request family ×3 incl. the updated FileGuards expectation, succession family ×2, owner transfer, OrgSlug_Uniform404, invitation round-trip, fingerprint baseline).Review-finding mapping
Deferred to tracking issues: domain-layer [this] conventions, org resolution without openid, domain unit-test gap, callback indentation, introspection org_id semantics doc, fire-and-forget tail scopes reconcile, social login state (feature), modal dedup, RFC 7591 yaml wording, admin-endpoint tag drift, list() double-response guard wiring, fail-closed owners hot-path ops note.