Skip to content

fix: checksum address validation, polling-abort safety (#143, #142, #140, #138) - #1028

Merged
Austinaminu2 merged 1 commit into
FlowwStar:mainfrom
christabel888:fix/christabel888-batch
Oct 18, 2026
Merged

Austinaminu2 merged 1 commit into
FlowwStar:mainfrom
christabel888:fix/christabel888-batch

Conversation

@christabel888

Copy link
Copy Markdown
Contributor

Summary

  • security: Add Stellar ed25519 address checksum validation on frontend #143 — Added validateStellarAddress() in lib/stellar.ts, which classifies an invalid address as either format (wrong shape entirely) or checksum (right length/prefix/alphabet but a bad CRC-16 — the classic single-mistyped-character near-miss). Wired it into the create-stream form and the batch-upload CSV row validation so each surfaces a specific "Invalid checksum" message instead of a generic one. StrKey.isValidEd25519PublicKey() was already the underlying boolean check on both surfaces; this adds the distinct messaging the acceptance criteria calls for. Added unit + component tests covering valid/format/checksum cases.
  • bug: Potential memory leak from polling intervals on component unmount #142 — useStreams/useStream (hooks/use-streams.ts) already created exactly one polling interval per mount and cleared it correctly on unmount/StrictMode remount, with per-request AbortController already cancelling stale in-flight requests before starting a new one. The one gap against the acceptance criteria: nothing aborted the still in-flight request specifically on unmount. Added that. Added tests pinning down the interval lifecycle (one tick per pollInterval, cleared exactly once on unmount, no orphaned fetches firing after unmount).
  • bug: top_up() doesn't update linear_amount field, causing stale stream metadata #140 — Verified top_up() in contracts/streaming/src/lib.rs already updates linear_amount on both branches (past-cliff re-anchor and pre-cliff growth), and this is already covered by test_top_up_before_start_time_updates_deposit_and_rate (assert_eq!(stream.linear_amount, total + additional)). No code change made — already resolved on main.
  • bug: Duplicate useCallback definitions in use-contract.ts overwrite each other #138 — Verified hooks/use-contract.ts has no duplicate useCallback definitions on main; createStream, withdraw, and estimateFee are each defined exactly once. No code change made — already resolved on main.

Test plan

  • vitest run __tests__/lib/stellar-address-validation.test.ts __tests__/components/create-form.test.tsx __tests__/components/batch-create-page.test.tsx __tests__/hooks/use-streams.test.ts
  • Manually mistype one character of a valid recipient address on the create-stream form and on a batch-upload CSV row; confirm the checksum-specific message appears on both.

Closes #143
Closes #142
Closes #140
Closes #138

🤖 Generated with Claude Code

…ng fixes

- FlowwStar#143: add validateStellarAddress() distinguishing a bad-checksum
  near-miss from a plain format error, and surface a specific "Invalid
  checksum" message on the create-stream form and batch-upload rows
  (StrKey.isValidEd25519PublicKey() was already used for the boolean
  check; this adds the specific messaging and tests the acceptance
  criteria call for).
- FlowwStar#142: abort any in-flight fetch in useStreams/useStream on unmount,
  not just when the next fetch starts. The interval lifecycle itself
  (one setInterval per mount, cleared on unmount, StrictMode-safe) was
  already implemented correctly — added tests pinning that down.
- FlowwStar#140: verified top_up() already updates linear_amount correctly and
  is already covered by an existing test (test_top_up_before_start_time_updates_deposit_and_rate).
  No code change needed; no fabricated change made.
- FlowwStar#138: verified hooks/use-contract.ts has no duplicate useCallback
  definitions on current main — createStream/withdraw/estimateFee are
  each defined exactly once. No code change needed.

Closes FlowwStar#143
Closes FlowwStar#142
Closes FlowwStar#140
Closes FlowwStar#138

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@christabel888 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! 🚀

Learn more about application limits

@Austinaminu2
Austinaminu2 merged commit 2fdb3f0 into FlowwStar:main Oct 18, 2026
1 of 7 checks passed

This branch had an error being deployed

1 failed deployment
staging — 191fed5a Deployed Oct 18, 2026 by christabel888 via deploy-staging #351
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants