Skip to content

fix: stream cancel visibility, wizard tx hash & post-submit stream matching - #1626

Merged
K1NGD4VID merged 1 commit into
LabsCrypt:mainfrom
p4uld4vid016-code:fix/issues-1203-1204-1205-1219
Oct 18, 2026
Merged

K1NGD4VID merged 1 commit into
LabsCrypt:mainfrom
p4uld4vid016-code:fix/issues-1203-1204-1205-1219

Conversation

@p4uld4vid016-code

Copy link
Copy Markdown
Contributor

Summary

Resolves four issues from the second-wave repository audit.

#1219 — Cancelled-via-API stream becomes invisible to status filters

  • backend/src/repositories/stream.repository.ts: new markCancelledProvisionally(streamId, txHash) writes the isActive=false update and a provisional CANCELLED StreamEvent in a single prisma..
  • backend/src/controllers/stream/cancel.ts now calls this helper instead of the event-less updateStatus.
  • backend/src/workers/soroban-event-worker.ts: handleStreamCancelled now reconciles the provisional event (updates ledger/timestamp/amount/metadata) instead of skipping it, so API-cancelled and indexer-cancelled paths dedupe naturally on the shared (transactionHash, eventType) key.
  • New real-DB integration test backend/tests/integration/cancel-status-filter.test.ts asserts the stream appears under status=cancelled (and disappears from status=active) immediately after the API cancel, plus reconciliation on the indexed event.

#1204 — Wizard's post-submit lookup can resolve to the wrong stream

  • StreamCreationWizard.startPolling now filters polled streams by the submitted recipient + deposit amount, then picks the most recent createdAt match — instead of blindly taking streams[0].
  • Added wizard tests covering an unrelated newer stream appearing first, an amount mismatch, and newest-match selection.

#1205 — No client-side Stellar address validation on /streams/create

  • Validation was already consolidated into validateAll() (validateStreamForm → validateRecipient → isValidStellarPublicKey) and shows an inline field error.
  • Added tests asserting a malformed address shows an inline error and never calls createStream, while a valid address does.

#1203 — Stream creation wizard never receives a real transaction hash

  • Already addressed on main (prop typed Promise<{ txHash: string }>, handleCreateStream returns the real SorobanResult, unsafe cast removed, txHash regression tests present). Verified and left as-is.

Testing

  • Backend: npx tsc --noEmit clean; full suite 847 passed / 3 skipped (one unrelated timing-flaky stream-actions claimable test passes in isolation).
  • Frontend: npx tsc --noEmit clean; ESLint clean on changed files; full suite 663 passed.

Closes #1219
Closes #1204
Closes #1205
Closes #1203

…ssues

- LabsCrypt#1219: write a provisional CANCELLED StreamEvent atomically with the
  API cancel status update so cancelled streams immediately appear under
  the 'cancelled' status filter; the indexer reconciles the provisional
  event with authoritative ledger data instead of dropping it.
- LabsCrypt#1204: wizard post-submit polling now matches the newly created stream
  by recipient, deposit amount and most-recent createdAt instead of
  blindly taking streams[0].
- LabsCrypt#1205: cover /streams/create client-side recipient validation with an
  integration test asserting an inline error and no createStream call.
- LabsCrypt#1203: verify the wizard surfaces the real transaction hash (already
  typed/returned correctly, with regression tests).

Closes LabsCrypt#1219
Closes LabsCrypt#1204
Closes LabsCrypt#1205
Closes LabsCrypt#1203
@K1NGD4VID
K1NGD4VID merged commit c86a157 into LabsCrypt:main Oct 18, 2026
13 checks passed
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