Repository navigation
fix(tips): confirm Product payments without EVM timeout - #237
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9130ff8bed
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
9 of 13 tasks
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.
Outcome
Tips and gifts now give an explicit finalized success state in the contribution panel, on the originating action, and in a transient global notice. Product CDM contributions no longer spend 90 seconds waiting for an incompatible EVM receipt after the host has already finalized the native extrinsic.
Issue and context
Refs #229.
Local scope:
docs/backlog/native-gifts-tips.md.The contribution write path can return two different kinds of hash:
waitFor: finalized.The UI previously sent both hashes to
viem.waitForTransactionReceipt. In Product this created a systematic 90-second timeout even when the contribution had succeeded. The raw viem exception then dominated the mobile panel and made a finalized tip look failed.Architecture and key concepts
RuntimeWritePortnow declares a contribution confirmation mode:evm-receipt: verify the EVM receipt, finality and matching contribution event;finalized-event: trust Product only for native extrinsic finalization, then independently read the finalizedContributionReceivedevent by deterministic contribution ID.sequenceDiagram participant UI as Contribution UI participant Host as Product CDM host participant Runtime as Artist runtime participant Read as Finalized EVM read model UI->>Host: musicGiftContribute(intentId, quote, value) Host->>Runtime: Revive call Runtime-->>Host: finalized native extrinsic hash Host-->>UI: finalized-event result loop bounded read-model catch-up UI->>Read: ContributionReceived(id = contributionId) end Read-->>UI: EVM receipt + exact shares UI-->>UI: Tip sent feedback and dated receiptThe durable contribution journal remains authoritative for retry behavior. A submitted hash is retained until a matching receipt is found; checking status never submits another contribution.
How it works
musicGiftContributeis submitted once and the intent reservation is persisted.Design decisions and tradeoffs
Tip sent, and the toast survives modal dismissal. No celebratory animation or fabricated social activity was added.Security, failure, and operations
ContributionReceivedevent matching its deterministic ID.VITE_DOTIFY_RUNTIME_ADAPTER=product-cdmbuild; this PR does not silently enable a new payment rail.Review guide
Suggested order
src/features/runtime/runtimePorts.ts,productCdmRuntimeAdapter.ts,viemRuntimeAdapter.ts: verify each adapter declares the correct hash/finality semantics.src/features/donations/contributions.ts: inspect the ID-filtered finalized event lookup and bounded confirmation strategy.src/features/donations/contributionFlow.ts: verify uncertain errors remain persisted and user copy does not expose SDK output by default.src/components/ArtistDonationButton.tsxandsrc/styles/contributions.css: review success, recovery, responsive layout and explorer-link behavior.Verify carefully
waitForTransactionReceiptwith a native extrinsic hash?musicGiftContributea second time?Validation
npm run test:unit -- src/features/donations/contributions.test.ts src/features/donations/contributionFlow.test.ts src/features/runtime/productCdmRuntimeAdapter.test.ts src/features/runtime/runtimeWriterProvider.test.tsnpm run test:e2e -- e2e/artist-gift.spec.tsnpm run buildVITE_DOTIFY_RUNTIME_ADAPTER=product-cdm npm run build:product-devnet:frozengit diff --checkKnown limitations and follow-ups
ContributionReceived.Metadata checklist
Dotify sprints)