Fix/shared settings state#941
Open
d3v-active wants to merge 4 commits into
Open
Conversation
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.
This PR addresses four distinct issues raised for the FlowFi frontend:
1.
useSettingsShared State RefactoruseSettingshook previously held per-instance state without a shared store or storage listener, meaning settings changes did not propagate across components or tabs.useSettingshook using a shared source of truth paired with a subscriber pattern.windowstorage event listener to automatically sync settings across different browser tabs.closes #854
2.
useIncomingStreamsUnit TestsuseIncomingStreamsanduseWithdrawIncomingStreamhooks.useIncomingStreams.test.tsvalidating query key shapes and hook execution conditions.useIncomingStreamsstays reliably disabled (prevents fetches) whenpublicKeyis null or undefined.useWithdrawIncomingStreamcorrectly rejects immediately when the user session is missing.QueryClientProviderwrapper to securely verifyonSuccessquery invalidation behavior.closes #855
3.
TokenStepAccessibility Improvementsrole="radio"andaria-checkedbindings on the token buttons.role="radiogroup"wrapper with an accessible group label (aria-labelledby).aria-describedby.closes #859
4. Dashboard Data Fetching Optimization (React Query Migration)
DashboardSnapshotdata fetching touseQueryutilizing@tanstack/react-query.AbortSignalall the way down to the API calls insidefetchStreamsto correctly cancel trailing pending requests when an SSE invalidates the cache again.queryClient.invalidateQueriesautomatically coalescing and deduplicating redundant sequential SSE-triggered invalidations, natively preventing request storms.queryClient.setQueryDatareplacing standard React component state.closes #857