Skip to content

docs(oidc): reword consumeCode docblock to lead with the lock, not Cache::pull#3666

Merged
marcelfolaron merged 2 commits into
masterfrom
docs/oidc-consume-docblock
Jul 20, 2026
Merged

docs(oidc): reword consumeCode docblock to lead with the lock, not Cache::pull#3666
marcelfolaron merged 2 commits into
masterfrom
docs/oidc-consume-docblock

Conversation

@gloriafolaron

Copy link
Copy Markdown
Contributor

Doc-only follow-up to the merged #3663 (lock-guarded consumeCode).

Marcel flagged a documentation mismatch. The OidcMobileCode::consumeCode() docblock (now on master) leads with "Cache::pull is get()+forget()…" even though the method uses Cache::lock. Reading the code, the doc appears to describe Cache::pull while the implementation locks — a perceived mismatch.

Reworded so the docblock leads with what the code does — the lock-guarded read-and-delete — and mentions Cache::pull only as the rejected alternative at the end (the reason a lock is needed). No behavior change; comment-only.

🤖 Generated with Claude Code

…che::pull

The docblock opened with 'Cache::pull is get()+forget()' even though the method
uses Cache::lock — in the diff it reads as if the doc describes pull while the
code locks. Reworded to lead with the lock-guarded read-and-delete (what the code
actually does) and mention Cache::pull only as the rejected alternative. No code
change.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NtfhjPwUEEHJb4Jf7714eR
Copilot AI review requested due to automatic review settings July 19, 2026 19:00
@gloriafolaron
gloriafolaron requested a review from a team as a code owner July 19, 2026 19:00
@gloriafolaron
gloriafolaron requested review from marcelfolaron and removed request for a team July 19, 2026 19:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Doc-only follow-up to #3663 that updates the OidcMobileCode::consumeCode() docblock so it describes the current lock-guarded “read-and-delete” behavior first, and mentions Cache::pull only as the rejected alternative (due to non-atomic get+forget semantics).

Changes:

  • Reworded consumeCode() PHPDoc to lead with the non-blocking cache-lock approach.
  • Moved the Cache::pull rationale into a parenthetical explanation at the end of the docblock.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +86 to +95
* The read-and-delete is guarded by a non-blocking cache lock keyed on the
* code: of two concurrent exchanges that both peekCode()'d it, only the lock
* holder performs the get()+forget() and can return true — so at most one
* exchange mints from a single-use code. A caller that can't take the lock (a
* concurrent consume is in flight) gets false and must not mint; so does an
* already-consumed or unknown code.
*
* (A bare Cache::pull is NOT used precisely because it is get()+forget(), not
* a single atomic op on any driver — two callers could both read the code
* before either deletes it, and both mint. The lock closes that window.)
Copilot nit: 'peekCode()'d' → 'called peekCode() on'; 'Cache::pull' → 'Cache::pull()'
for method-style consistency. Comment-only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NtfhjPwUEEHJb4Jf7714eR

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@marcelfolaron
marcelfolaron merged commit edea861 into master Jul 20, 2026
12 of 13 checks passed
@marcelfolaron
marcelfolaron deleted the docs/oidc-consume-docblock branch July 20, 2026 00:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants