fix: resend OTP button, optimistic contribution state, unified address validation, and claim-name security hardening (#341, #343, #334, #332) - #348
Merged
cypriannwokolo2-creator merged 2 commits intoAug 31, 2026
Conversation
…s validation, and claim-name security hardening (cocor-tech#341, cocor-tech#343, cocor-tech#334, cocor-tech#332)
|
Someone is attempting to deploy a commit to the Nzubechukwu 's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@software321dev Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR addresses four key security, usability, and data consistency issues in
cocor-tech/moistello-frontend:1. Wire up inert Resend button in withdraw OTP step (Closes #341)
handleResendOtpinOtpStepanduseWithdrawWizardwith:src/app/(dashboard)/wallet/withdraw/steps/otp-step.test.tsxverifying resend trigger, cooldown countdown, and loading state behavior.2. Correct optimistic update in
useContribute(Closes #343)useContributeused fabricated user IDs and lacked stable rollback handling, causing double invalidation and potential UI state mismatch.useContributeto leverageuseOptimisticMutationwith stable synthetic temp IDs (createTempId()),OPTIMISTIC_PENDING_USER_ID, snapshot-based cache rollbacks on error, and single invalidation on success. Ensured contribution modal incircles/[id]/page.tsxonly closes on successful contribution.src/hooks/__tests__/use-circles-optimistic.test.tsx.3. Unify Stellar address validation (Closes #334)
validateStellarAddressinsrc/lib/stellar/validate-address.tsenforcing Base32 RFC 4648 (A-Z2-7, length 56, starts withG). UpdatedWCSessionOrchestratorinsrc/lib/wallet/wc2-session-manager.tsand balance route insrc/app/api/wallet/balance/route.tsto use the canonical validator.src/lib/stellar/__tests__/validate-address.test.tscovering valid addresses, excluded Base32 characters (0,1,8,9), lowercase characters, length bounds, and invalid prefixes.4. Harden
/claim-nameanonymous endpoint (Closes #332)/claim-namewas an unauthenticated endpoint vulnerable to rate-limit exhaustion, name-squatting, and invalid character injection.POST /api/claim-nameinsrc/app/api/claim-name/route.tsfeaturing:^[a-z0-9_-]{3,30}$).src/app/api/claim-name/route.test.tstesting success, unauthenticated rejection, input format validation, ownership binding protection, and rate limiting.Verification
npx tsc --noEmitwith 0 type errors.Closes #341
Closes #343
Closes #334
Closes #332