Repository navigation
feat(onboarding): pass a Captcha stage from the website - #423
Conversation
The website checks the captcha with Turnstile and inserts an OnboardingRequest. The bot passes the member under their lock, as the button of the verification message does, and writes why it could not.
Architecture Inside the changed components — 1 viewComponent view — Onboarding verification Internal components handling website captcha events and member progression.
Data flow Data model Tip Open a diagram on the canvas, then press W or click play to walk through the change one step at a time 🪧 More tips
Thanks for using PR Lens! It's free for OSS. If it helped, a star helps other teams find it. |
There was a problem hiding this comment.
ℹ️ No critical issues, one rough edge in the migration.
Approach: sound. The website cannot give the role or write OnboardingVerification, so a notified request row that the bot re-validates under the member's lock follows the AppealRequest and JoinGuardRequest pattern, with no new mechanism.
Reviewed changes: the full diff of the single commit (generated snapshots and ops.json skimmed only).
- Contract and storage.
OnboardingRequesttable, migration20261127T1618_add_onboarding_requestsand therequests.tshelpers (fetchUnprocessedOnboardingRequest,completeOnboardingRequestas one conditionalUPDATE,fetchPendingOnboardingRequestIds). - Request handling.
handleOnboardingRequestleases the request, re-reads the row under the member lock, rejects stale rows, disabled stages and non-Captchastages, fails an expired one as the time limit job would, and otherwise passes throughpassOnboardingStageLocked. - Wiring.
onboarding_requestchannel,onboardingRequestshard message, a thirdRequestQueueinwebsiteNotifications, and the local and shard-manager targets. - Member side. The
Captchabranch of the verification button now answers with a link button to/verify/<guild>, andOnboardingNoticeButtonis anAction | Linkunion.OnboardingCaptchaAvailableis nowtrue. - Tests and docs. Handler, render and listener tests, and the
AGENTS.mdonboarding entry.
claude-sonnet-5-5 | 𝕏
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #423 +/- ##
==========================================
+ Coverage 62.88% 63.05% +0.17%
==========================================
Files 287 288 +1
Lines 10246 10295 +49
Branches 2456 2470 +14
==========================================
+ Hits 6443 6492 +49
+ Misses 3367 3365 -2
- Partials 436 438 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A request swept after the member left and joined again passed or failed them on the row of the stay that ended. The member is now read under their lock, and the sweep reads the pending requests by a partial index.
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes: the one new commit since the last pullfrog review (ad2ce5b), which also folds in the migration fix.
- Current-stay check.
handleOnboardingRequestnow refuses a row older than the member's current join (selectCurrentStay([verification], member.joinedTimestamp)), answeringstale, so a queued request of an earlier stay cannot pass a member who left and rejoined. This is the same checkmembers.tsuses for leave handling. - Member fetch under the lock.
fetchOnboardingMembermoved insidewithOnboardingMemberLock, so the join timestamp is read in the same critical section as the verification row. - Pending index. The migration now creates
OnboardingRequest_created_at_pending_idx(created_atwhereprocessed_at IS NULL) throughrawSql, withops.jsonand the migration hash updated; this resolves the earlier thread. - Tests. A new case covers a row of an earlier stay (no pass, no fail,
stalewritten); the sharedmemberfixture getsjoinedTimestamp: null.
claude-sonnet-5-5 | 𝕏
# Conflicts: # projects/database/migrations/app/refs/db.json

🔗 Linked issue
Related to #418 and wolfstar-project/wolfstar.rocks#613. The website side follows in a wolfstar.rocks pull request that pins this contract.
❓ Type of change
📚 Description
The
Captchachallenge was in the contract but blocked: the button answered that the stage is not available yet. The website checks the captcha, but only the bot gives the stage's role and writesOnboardingVerification. So the website needs a way to ask the bot to pass the member.OnboardingRequestholds the guild, the user, theWaitingverification the page read,processedAtanderror. The website inserts it withNOTIFY onboarding_request, '<id>'in the same transaction, asAppealRequestdoes. The migration is20261127T1618_add_onboarding_requests.Captchastage, the verification button now answers with a link button to/verify/<guild>.OnboardingNoticeButtonis now anActionor aLink.websiteNotificationsstarts a thirdRequestQueue, with a sweep for lost notifications.handleOnboardingRequestleases the request and checks, under the member's lock, that the row still waits at an enabledCaptchastage. Then it passes the member throughpassOnboardingStageLocked, the button's own path. A stage whose time ran out fails as the time limit job would fail it.processedAtonce. When it could not pass the member, it also writeserroras<code>: <detail>, with the codeoff,notMember,stale,expired,roleRefusedorfailed.Captchastage.OnboardingCaptchaAvailableis nowtrue, so the panel offersCaptcha.

Confidence Score: 5/5
No new blocking issue was found in the bot-side changes.Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile