Repository navigation
fix(server): pairing tokens work on Node versions that cannot bind booleans - #16730
chisewaguri wants to merge 1 commit into
Conversation
…oleans The pairing link consume query bound a JavaScript boolean. node:sqlite in Node 24.18.1 rejects that, so every one-time pairing failed with HTTP 500. package.json allows ^24.13.1. Bind 1 or 0 instead.
ApprovabilityVerdict: Not approved Macroscope's review found this PR not approvable — This one-line fix preserves pairing-scope logic while replacing boolean SQLite bindings with compatible integer values, addressing failures on affected Node versions. Because it changes authentication and pairing-token persistence behavior, the sensitive-authentication review requirement applies despite the narrow scope. You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe consume query now uses numeric values for its optional requested-scope condition. The overlap check remains unchanged. ChangesPairing link consumption
Priority: ➖ Normal Estimated code review effort: 1 (Trivial) | ~5 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to Pairing continues to handle omitted and supplied scopes as intended while avoiding boolean SQLite binds. No actionable user-facing risk remains before merge. Architecture SummaryArchitecture risk: 🔵 Low · up to The change affects 1 system. Changed systems: Architecture concerns Review detailsSystems and components
Before / after behavior
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
Full details: ApprovabilityExplanation The PR changes pairing behavior in
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Problem
One-time pairing fails with HTTP 500 on Node 24.18.1.
AuthPairingLinkRepository.consumeAvailablebindsrequestedScopes === undefined, a JavaScript boolean, andnode:sqlitein that version rejects it withProvided value cannot be bound to SQLite parameter 5. The pairing page shows "Primary environment request failed during exchange-bootstrap-credential (HTTP 500)".package.jsonallows^24.13.1. CI resolves to 24.21.0, which accepts booleans, so CI passed when #9785 added the bind.Change
Bind
1or0instead of the boolean. SQLite has no boolean type, so theORcheck behaves the same.Scope and approval
This is a one-line fix for an obvious regression from #9785. Pairing a browser or phone with a one-time token fails on any Node version that rejects boolean binds.
Verification
vp test run apps/server/src/auth/PairingGrantStore.test.tsfails 6 of 10 tests onmainwith the bind error and passes 10 of 10 with this change.node:sqlitewithprepare("select ? as v").get(true): Node 24.18.1 throwsProvided value cannot be bound to SQLite parameter 1, and Node 24.21.0 returns{ v: 1 }./api/auth/browser-session.