Repository navigation
feat: error report, low reserve alert, balance refetch, realtime stream - #823
Merged
Jaydbrown merged 1 commit intoOct 18, 2026
Conversation
|
@Gbemi-programmer 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.
Closes #758
Closes #757
Closes #756
Closes #755
Changes
#758 Error page: troubleshooting steps and copyable error report
lib/error-report.ts:categorizeError()sorts an error into network, wallet, contract or unknown.buildErrorReport()builds a report with the error message, digest, URL, user agent and stack trace.app/error.tsxshows the suggestions for the error's category and adds a Copy Error Report button.#757 Low native XLM reserve alert
hooks/useWalletBalance.ts:queryKeys.wallet.balance(address).isLowReserve, which istruewhen the balance is below 2.0 XLM.#756 Refetch token balance after deposit
hooks/useTokenBalance.ts:useTokenBalanceuses the query key['tokenBalance', address, token].invalidateTokenBalance()invalidates that key.app/create/page.tsxcallsinvalidateTokenBalance()after a stream is created, so the displayed balance updates straight away.#755 Realtime stream updates
hooks/useStreamRealtime.ts:useStreamRealtime(streamId)opens a Horizon server-sent events stream (/accounts/{id}/operations?cursor=now) and invalidates that stream's queries on every event. Horizon has no/eventsendpoint for contracts, so this endpoint is used instead.EventSourceis unavailable, so the existing polling stays as the fallback.Tests
lib/error-report.test.ts: error categories and report contents.hooks/__tests__/balanceHooks.test.tsx: the 2 XLM threshold,isLowReservefrom a mocked Horizon response, and a refetch after invalidation.hooks/__tests__/useStreamRealtime.test.tsx: the stream URL, invalidation on each event, closing on unmount, and no stream when there is no id.npx vitest runon these files andapp/create: 34 passed.tscshows no errors in the changed files. eslint is clean except for oneexhaustive-depswarning inapp/create/page.tsxthat is already onmain.Notes
mainalready has failing tests in unrelated files. This PR does not touch them.