Add structured log for trade panel price preview fetch failure - #662
Merged
Conversation
…ptimistic buy updates
…gination without duplicates
…eview fetch failure with creator and quantity context
…ation with result data
|
@infimum90 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 #655 — src/hooks/tests/optimisticBuy.test.ts
Created 2 unit tests verifying useTradeMutation's onMutate cache isolation:
does not mutate the cache of a different creator — confirms only the target creator's holdings are updated
rolls back only the affected creator's cache on error — confirms onError restores only previousHoldings for the correct creator, leaving unrelated creators untouched
Uses renderHook within QueryClientProvider, and queryClient.setQueryData for rollback isolation assertions.
Closes #651 — src/pages/tests/creatorInfiniteScroll.test.tsx
Created 2 integration tests for infinite scroll pagination (7 creators, PAGE_SIZE=6):
appends without duplicating — renders 6 on page 1, clicks "Load more", confirms all 7 appear with no duplicates and the button disappears
keeps page 1 visible — same flow but asserts the first 6 creators remain present after page 2 loads
Mocks CreatorCard, FeaturedCreatorAudienceChip, StellarConnectionQualityBadge, framer-motion, useNetworkMismatch, useStaleData, and courseService.getCourses. Sets localStorage to 'infinite' mode. Handles the 300ms filter-loading state via findByRole retries.
Closes #652 — src/components/common/TradeDialog.tsx
Added console.debug('[price-preview-failure]', {...}) when the dialog opens and the price preview can't be computed:
buy — keyPriceStroops is null (logs key_price_missing)
sell — estimatedProceedsStroops is null (logs estimate_unavailable)
Both logs include creator_name, quantity, side, and timestamp. Guarded by process.env.NODE_ENV !== 'test' and a useRef flag preventing re-logs within the same dialog session.
Closes #653 — src/pages/LandingPage.tsx
Added console.debug('[trade-confirmation-failure]', {...}) in handleConfirmTrade's catch block, including creator_name (FEATURED_CREATOR_NAME), side (buy/sell), quantity (amount), error (serialized message), and timestamp. Guarded by process.env.NODE_ENV !== 'test'.