Repository navigation
fix(auth): tolerate unreadable dashboard fingerprints at startup - #1086
izadoesdev merged 3 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
@FindMalek is attempting to deploy a commit to the Databuddy OSS Team on Vercel. A member of the Team first needs to authorize it. |
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📜 Recent review details
WalkthroughThe dashboard auth-secret check now treats a rejected response-body JSON parse as a missing body. New tests cover malformed responses, fetch failures, secret matches and mismatches, and configurations that skip the request. ChangesDashboard auth-secret check
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix Suggested reviewers: Merge Risk: ⚪ Minimal · up to
|
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. | Write docstrings for the functions missing them to satisfy the coverage threshold. |
✅ Passed checks (4 passed)
-
Check name Status Explanation Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled. Title check ✅ Passed The title clearly summarizes the main change: auth startup now tolerates unreadable dashboard fingerprints. Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches 💡 1
-
🛠️ Fix failing CI checks 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
[Medium impact] The PR appears safe to merge; unreadable responses warn, while confirmed mismatches still reject. SummaryDashboard fingerprint responses that cannot be read as JSON now use the existing warning path instead of stopping API startup.
Reviews (3) · Last reviewed commit: "test(auth): keep only the fingerprint sc..." · Reviewed by Greptile |
acf46d6 to
2099347
Compare
|
@coderabbitai full review Please review the complete final two-file auth slice on 2099347 against main, including the real-function regression tests. The existing runtime shape validation, confirmed mismatch rejection and synchronous fatal API logging are preserved. |
|
@greptile-apps review Please review the final two-file slice on 2099347 against main. Both earlier findings are fixed: the API structured-log change is removed and 11 real-function regressions cover malformed responses, secret mismatch rejection and skipped environments. |
✅ Action performedFull review finished. |
|
Final-head review dispositions for 2099347:
|
|
merged main into this branch to clear the behind-main status, no changes to the reviewed files (apps/api/src/index.ts, packages/auth/src/auth.ts, packages/auth/src/auth-secret-fingerprint.test.ts are untouched by the merge). just picking up unrelated upstream commits so this can merge cleanly whenever you're ready. |
|
@izadoesdev ready whenever, cant add you as reviewer myself (no write access). only red checks are the vercel preview auths you already flagged |
A 200 with a non-JSON body from the dashboard (or a proxy in front of it) rejected outside the fetch catch, so the API exited without confirming the secrets differ. Treat it like an unreachable dashboard and only warn. Also log the fatal mismatch through evlog instead of console, and drop the `unknown` annotations. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e89a7bb to
395e230
Compare
e7e4b6f
into
databuddy-analytics:staging
An unreadable dashboard fingerprint response can abort API startup before the existing warning path runs. Treat invalid JSON as an unavailable fingerprint, preserving the runtime object/string checks and the fatal rejection of a confirmed secret mismatch. Keep the existing synchronous API startup error output.
Validation: 11 isolated tests exercise the real auth guard and fingerprint endpoint, covering malformed JSON, invalid payloads, unreachable/non-OK responses, matching and mismatched secrets, and self-hosted/development skips. The main-source baseline reproduces the malformed-JSON failure; a mutation that bypasses mismatch rejection fails the relevant test.
bun run lintandbun run check-typespassed.AI disclosure: Codex assisted the maintainer cleanup, review and regression tests.
Summary by CodeRabbit