Skip to content

Improve onboard friend logic#688

Merged
feruzm merged 3 commits into
developfrom
onb
Mar 4, 2026
Merged

Improve onboard friend logic#688
feruzm merged 3 commits into
developfrom
onb

Conversation

@feruzm
Copy link
Copy Markdown
Member

@feruzm feruzm commented Mar 4, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Preserve referral and other fields through the friend onboarding/signup flow; fix encoding/decoding edge cases
    • Show raw usernames/emails in confirm and success views to prevent formatting issues
    • Improved error handling for account creation and RC delegation with clearer failure states
    • Stricter RC amount validation (NaN treated as invalid) and guards against undefined decoded data
  • Tests

    • Added comprehensive base64 onboarding test suite covering roundtrips, referrals, emails, pubkeys, and end-to-end flows

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 4, 2026

Warning

Rate limit exceeded

@feruzm has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 28 minutes and 19 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 82cf1e36-959f-4b15-a5b7-709e8c1c4f37

📥 Commits

Reviewing files that changed from the base of the PR and between 70c360b and 2c6a61e.

📒 Files selected for processing (2)
  • apps/web/src/app/onboard-friend/[...slugs]/_page.tsx
  • apps/web/src/specs/utils/b64-onboard.spec.ts
📝 Walkthrough

Walkthrough

The changes switch the onboard-a-friend flow to use raw decoded username/email (including referral) everywhere, add robust error handling and RC validation, introduce a comprehensive base64 URL-safe encode/decode test suite, and adjust the b64uDec utility to preprocess input and return a string.

Changes

Cohort / File(s) Summary
Onboarding Page Component
apps/web/src/app/onboard-friend/[...slugs]/_page.tsx
Replaced formatted username/email with raw decodedInfo fields; included referral in encode/data flows; removed format helpers; added try/catch around account creation and RC delegation; improved RC amount validation and UI guards for decodedInfo.
Base64 Utility
apps/web/src/utils/b64.ts
Changed b64uDec signature to return string; preprocesses input by replacing -, _, . with base64 chars before decoding rather than post-processing.
Onboarding Test Suite
apps/web/src/specs/utils/b64-onboard.spec.ts
Added new tests validating base64 URL-safe encode/decode roundtrips, field preservation (username, email, referral, pubkeys), RC amount edge cases, error handling paths, and end-to-end onboarding scenarios.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

patch

Poem

🐇 I hopped through bytes and b64 light,

Raw names and emails held tight,
Referrals tucked in every code,
Errors fenced where dangers strode,
Tests aplenty — a carroted delight!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Improve onboard friend logic' is vague and generic, using a broad term 'improve' without specifying the actual changes or the nature of the improvements made. Consider a more specific title that highlights the main change, such as 'Refactor onboard friend to use raw username/email values' or 'Add error handling and validation to onboard friend flow'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch onb

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

coderabbitai[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

@feruzm feruzm marked this pull request as draft March 4, 2026 10:51
@feruzm feruzm marked this pull request as ready for review March 4, 2026 10:51
@feruzm feruzm merged commit 51d1b93 into develop Mar 4, 2026
1 check passed
@feruzm feruzm deleted the onb branch March 4, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant