fix(trades): remove spurious badge dot and pending status flash - #86
Conversation
Badge: change notification count logic from 'unseen if no prior snapshot' to 'unseen only if status changed from a known prior state'. With an empty _lastSeenStatusesProvider on app start every non-terminal trade counted as unseen, causing the red dot to appear before the user had missed anything. Status flash: remove the immediate yield of OrderStatus.pending from tradeStatusProvider. The pending yield was overriding the correct DB-stored status for 2 s until the first real getOrder() fetch completed. TradesListItem already falls back to trade.status (DB value) while the stream is in loading state, so removing the bogus yield shows the correct status from the start.
|
Caution Review failedPull request was closed or merged during review WalkthroughThis PR refines polling behavior in the trade status provider by removing an immediate pending status fallback and adjusting fetch timing, while tightening the badge-count logic to exclude trades lacking a prior seen-status snapshot. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Badge: change notification count logic from 'unseen if no prior snapshot' to 'unseen only if status changed from a known prior state'. With an empty _lastSeenStatusesProvider on app start every non-terminal trade counted as unseen, causing the red dot to appear before the user had missed anything.
Status flash: remove the immediate yield of OrderStatus.pending from tradeStatusProvider. The pending yield was overriding the correct DB-stored status for 2 s until the first real getOrder() fetch completed. TradesListItem already falls back to trade.status (DB value) while the stream is in loading state, so removing the bogus yield shows the correct status from the start.
Summary by CodeRabbit
Bug Fixes
Performance Improvements