You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The admin API revokes links by the hash prefix displayed in the list UI. If two active hashes share that prefix, the current loop revokes whichever record happens to appear first, potentially disabling the wrong user's invite while leaving the intended one valid.
Root cause and invariant
The endpoint mutated and returned on the first prefix match without proving uniqueness. The invariant is that a shortened identifier may authorize a destructive state change only when it resolves to exactly one active record.
The endpoint now collects active matches under the store lock, returns 409 with guidance when the prefix is ambiguous, and writes only after a unique match is established.
Overlap check
Searched open and closed PRs for magic link revoke prefix collision, ambiguous token hash prefix, and the changed router/test files. No semantic match or open same-file PR was found. This is independent from token generation, redemption, and store durability.
Regression coverage
A FastAPI boundary test persists two active records with the same displayed eight-character prefix, calls the authenticated DELETE endpoint, asserts 409, and reloads the store to prove neither record was revoked.
Prefix collisions are rare, but the check is O(n) over an already capped local store and happens inside the existing lock. Operators can retry with a longer prefix; exact hashes remain unambiguous. Revert restores first-match mutation with no migration.
Validated merge order: #2989 ? #2990 ? #2993 ? #2991 ? #2992 ? #2994 ? #2995 ? #2996 ? #2997 ? #2998. The changes are independently useful; this order only reconciles shared model-router and magic-link files.
Synthetic integration head: origin/batch/quality-ten-20260822-round2-integration at 91eb730d. The only textual conflict was the two model-router tests inserting at the same class boundary; the integration resolution retains both contracts. Magic-link changes merged cleanly.
All required GitHub checks are green across the batch. #2992 initially hit a transient openSUSE repository/mirror failure while installing rsync; a clearly labeled empty retry commit reran the unchanged tree, and openSUSE plus the full matrix passed.
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
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.
Why this matters
The admin API revokes links by the hash prefix displayed in the list UI. If two active hashes share that prefix, the current loop revokes whichever record happens to appear first, potentially disabling the wrong user's invite while leaving the intended one valid.
Root cause and invariant
The endpoint mutated and returned on the first prefix match without proving uniqueness. The invariant is that a shortened identifier may authorize a destructive state change only when it resolves to exactly one active record.
The endpoint now collects active matches under the store lock, returns 409 with guidance when the prefix is ambiguous, and writes only after a unique match is established.
Overlap check
Searched open and closed PRs for
magic link revoke prefix collision,ambiguous token hash prefix, and the changed router/test files. No semantic match or open same-file PR was found. This is independent from token generation, redemption, and store durability.Regression coverage
A FastAPI boundary test persists two active records with the same displayed eight-character prefix, calls the authenticated DELETE endpoint, asserts 409, and reloads the store to prove neither record was revoked.
Validation
pytest -q ods/extensions/services/dashboard-api/tests/test_magic_link.py -x? 67 passedpython -m py_compile ods/extensions/services/dashboard-api/routers/magic_link.py ods/extensions/services/dashboard-api/tests/test_magic_link.pygit diff --checkTradeoffs and rollback
Prefix collisions are rare, but the check is O(n) over an already capped local store and happens inside the existing lock. Operators can retry with a longer prefix; exact hashes remain unambiguous. Revert restores first-match mutation with no migration.