Skip to content

Fix wallet-connect polling race and implement subscription storage I/O - #1218

Merged
Kingsman-99 merged 1 commit into
Stellar-split:mainfrom
Joel234-png:fix/issues-1140-1141-1142-1143
Nov 26, 2026
Merged

Kingsman-99 merged 1 commit into
Stellar-split:mainfrom
Joel234-png:fix/issues-1140-1141-1142-1143

Conversation

@Joel234-png

Copy link
Copy Markdown
Contributor

#1140: Verified InvoiceCard.tsx and InvoiceCard.test.tsx against each other line by line — invoice id, status badge, truncated addresses, funded amount text, FundingProgress, displayNumber, and DeadlineCountdown gating all already match the test's expectations exactly. No bug found, no change made. Closes #1140

#1141: QRModal.tsx had two redundant polling useEffects both watching wallet-connect status, and the primary one fired an immediate isWalletConnected() check synchronously on mount instead of waiting for the first pollingInterval tick. This made the component call onConnected before the interval elapsed, breaking any caller relying on pollingInterval as a minimum delay (e.g. a 500ms poll firing before 400ms had passed). Removed the duplicate second effect entirely and changed the first effect to schedule its first check via setTimeout(check, pollingInterval) rather than invoking it immediately, so the very first wallet check now also respects the configured delay. Closes #1141

#1142: SubscriptionDetailClient.test.tsx seeds localStorage with a subscription under the "stellar_split_subscriptions" key, but src/lib/subscriptions.ts's loadSubscriptions() and saveSubscriptions() were both complete no-op stubs — loadSubscriptions always returned an empty array and saveSubscriptions never wrote anything — so the detail page could never find the seeded subscription and always rendered the "Subscription not found" error state. Implemented both functions for real: loadSubscriptions reads and JSON-parses the localStorage array, reviving bigint fields (recipient amounts, totalUsdcCollected, invoice history amounts) from their serialized string form, with an optional creator-publicKey filter matching the existing call site in analytics/page.tsx; saveSubscriptions serializes bigints back to strings and writes the array back. Closes #1142

#1143: Verified SubscriptionCard.tsx against SubscriptionCard.test.tsx — status labels, frequency, next-run dash-when-paused, invoice count, detail-page link, and USDC formatting (including the 0/partial-decimal/large-amount cases) all already match, since formatSubscriptionForDisplay (unlike loadSubscriptions/saveSubscriptions) was already a real implementation, not a stub. No bug found, no change made. Closes #1143

Stellar-split#1140: Verified InvoiceCard.tsx and InvoiceCard.test.tsx against each other line by line — invoice id, status badge, truncated addresses, funded amount text, FundingProgress, displayNumber, and DeadlineCountdown gating all already match the test's expectations exactly. No bug found, no change made. Closes Stellar-split#1140.

Stellar-split#1141: QRModal.tsx had two redundant polling useEffects both watching wallet-connect status, and the primary one fired an immediate isWalletConnected() check synchronously on mount instead of waiting for the first pollingInterval tick. This made the component call onConnected before the interval elapsed, breaking any caller relying on pollingInterval as a minimum delay (e.g. a 500ms poll firing before 400ms had passed). Removed the duplicate second effect entirely and changed the first effect to schedule its first check via setTimeout(check, pollingInterval) rather than invoking it immediately, so the very first wallet check now also respects the configured delay. Closes Stellar-split#1141.

Stellar-split#1142: SubscriptionDetailClient.test.tsx seeds localStorage with a subscription under the "stellar_split_subscriptions" key, but src/lib/subscriptions.ts's loadSubscriptions() and saveSubscriptions() were both complete no-op stubs — loadSubscriptions always returned an empty array and saveSubscriptions never wrote anything — so the detail page could never find the seeded subscription and always rendered the "Subscription not found" error state. Implemented both functions for real: loadSubscriptions reads and JSON-parses the localStorage array, reviving bigint fields (recipient amounts, totalUsdcCollected, invoice history amounts) from their serialized string form, with an optional creator-publicKey filter matching the existing call site in analytics/page.tsx; saveSubscriptions serializes bigints back to strings and writes the array back. Closes Stellar-split#1142.

Stellar-split#1143: Verified SubscriptionCard.tsx against SubscriptionCard.test.tsx — status labels, frequency, next-run dash-when-paused, invoice count, detail-page link, and USDC formatting (including the 0/partial-decimal/large-amount cases) all already match, since formatSubscriptionForDisplay (unlike loadSubscriptions/saveSubscriptions) was already a real implementation, not a stub. No bug found, no change made. Closes Stellar-split#1143.
@vercel

vercel Bot commented Nov 26, 2026

Copy link
Copy Markdown

@Joel234-png is attempting to deploy a commit to the kingsman-99's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Kingsman-99
Kingsman-99 merged commit 0bf2192 into Stellar-split:main Nov 26, 2026
1 check failed
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