fix(auth): address code-review findings on VerifyOTPResponse - #1205
Conversation
- VerifyOTPResponse.init(from:) now throws a descriptive dataCorruptedError on an unrecognized shape instead of letting EmailChangeConfirmation's own decode failure leak through unwrapped, matching AuthResponse's existing behavior. - Fix the emailChangeConfirmationPending doc comment, which assumed the new email always confirms second; GoTrue doesn't enforce an order between the two confirmations. - Add a test locking in that a bare user (no session) is correctly not a valid VerifyOTPResponse shape, since /verify never returns one (unlike signUp). - Drop a stray "docs/superpowers/" reference in the isolated integration-test project's config.toml comment. - Restore the explanation of why the breaking-change marker matters (release-please/API-stability check) that got dropped when this branch's migration-guide convention replaced main's during rebase.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughSummary by CodeRabbit
Walkthrough
Possibly related PRs
Mergeability Score: ⚪ Minimal · up to This PR makes localized corrections to OTP response decoding, documentation, tests, and repository guidance; no actionable merge-blocking risk remains after normal checks and review. 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 |
Coverage Report for CI Build 31689724997Coverage decreased (-0.9%) to 83.769%Details
Uncovered Changes
Coverage Regressions85 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
|
The following capabilities are marked
These may have been renamed, removed, or never registered. Please update the capability matrix. |
Summary
Follow-up to #1088 (already merged) addressing findings from a post-merge code review of that PR's
VerifyOTPResponsechange.Changes
Sources/Auth/Types.swift:VerifyOTPResponse.init(from:)now throws a descriptivedataCorruptedErroron an unrecognized shape instead of lettingEmailChangeConfirmation's own decode failure leak through unwrapped — matchesAuthResponse's existing behavior for the same situation.emailChangeConfirmationPendingdoc comment, which assumed the new email always confirms second. GoTrue doesn't enforce an order between the two confirmations — whichever of the two hasn't confirmed yet is the one still pending.Tests/AuthTests/AuthResponseTests.swift: added a test locking in that a bare user (no session) is correctly not a validVerifyOTPResponseshape, since/verifynever returns one (unlikesignUp, which can).docs/superpowers/reference in the isolated integration-test project'sconfig.tomlcomment — that path isn't documentation for this.AGENTS.mdexplaining why the breaking-change marker matters (release-please and the API stability check key off it) — this was dropped when this branch's migration-guide convention replaced main's equivalent section during a rebase, and got missed before merge.Test plan
swift test --filter "AuthTests|SupabaseTests"— 257 tests passsupabase/authGo source (internal/api/verify.go) thatverifyPosthas exactly two response paths — the{msg,code}map or a full session viaissueRefreshToken— confirmingVerifyOTPResponsecorrectly has no bare-user case