feat(auth-service): show current handle on account settings page - #99
Conversation
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, reopen this pull request to trigger a review.
🦋 Changeset detectedLatest commit: 9cfe280 The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 3 minutes and 59 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
🚅 Deployed to the ePDS-pr-99 environment in ePDS
|
Coverage Report for CI Build 24687298539Coverage increased (+0.2%) to 37.013%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
Adds a "Current Handle:" row to the /account settings page, resolved from the PDS via com.atproto.repo.describeRepo. This lets users see their authoritative handle before using the update form. Also un-pends the previously-@pending "User changes their handle" scenario in account-settings.feature — its step definitions already existed but expected the settings page to display the current handle, which it didn't. Removes the stale "handle update on /account is not implemented yet" comment now that the handle-change flow is testable end-to-end. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The describeRepo lookup was added inline in the account-settings GET handler in the previous commit, which dragged coverage down by ~0.2% without giving the error paths any unit test. Move it into packages/auth-service/src/lib/get-handle-by-did.ts (matching the shape of lib/get-did-by-email.ts) and cover the happy path plus all the null-returning branches (non-string handle, non-OK responses, 404, 500, network error, timeout, malformed JSON). Pure refactor — no behaviour change on the settings page. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Silences SonarCloud "insecure http protocol" hotspot on the test constant. The URL is mocked — never dialled — so scheme is cosmetic. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
a5e243c to
9cfe280
Compare
|
On pull_request, `actions/checkout`'s default is the GitHub-synthesized merge commit (refs/pull/N/merge = base + head). Railway, however, deploys the PR branch head — Railway has no native way to deploy merge commits (https://docs.railway.com/deployments/github-autodeploys). The mismatch means when main advances between rebases, E2E test code from the merge commit can assert against UI/behaviour that exists in main but not yet in the PR branch's Railway deployment. Symptom: tests newly added on main fail on unrelated PRs until the PR is rebased (e.g. the "Current Handle:" row introduced by #99 broke #93's CI). Pin checkout to `github.event.pull_request.head.sha` so test code and deployed runtime share one SHA. Empty on push / workflow_dispatch falls back to actions/checkout's default (GITHUB_SHA for the triggering event), verified against the v6.0.2 source. Trade-off: PR CI no longer catches main-incompatibilities until the branch is rebased, but rebase was the mitigation anyway — this just makes the contract explicit instead of surfacing as confusing unrelated failures.



Summary
/accountsettings page, resolved from the PDS viacom.atproto.repo.describeRepo. The row displays the authoritative handle and gracefully falls back to(unknown)if the PDS describeRepo call fails.User changes their handlescenario infeatures/account-settings.feature. Its step definitions already existed (introduced alongside PR test(e2e): implement welcome OTP email scenario (email-delivery) #91's account-settings E2E work) and asserted that the page showsCurrent Handle:— the missing UI on the server side is what was keeping the scenario gated.POST /account/handleroute has been in place for a while; what was actually missing was the display, not the update.Also includes a changeset describing the user-visible change.
Test plan
pnpm typecheckpassespnpm format:check/pnpm lintpasspnpm test— all 443 unit tests passpnpm test:e2e --dry-run features/account-settings.featureshows no undefined/ambiguous stepsUser views their account informationnow shows the handle row;User changes their handleruns end-to-end (handle rename → settings reflect it → resolveHandle returns expected DID)🤖 Generated with Claude Code