-
Notifications
You must be signed in to change notification settings - Fork 17
feat: add invalid_fiat_currency error handling with session cleanup #331
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add invalidFiatCurrency to CantDoReason enum - Fix bug in NotificationListenerWidget: change values['action'] to values['reason'] - Add localized error messages for invalid fiat currency in en/es/it - Add session cleanup and navigation for invalidFiatCurrency errors - Update CantDoNotificationMapper with new error type
WalkthroughThe pull request adds support for handling invalid fiat currency scenarios. A new enum constant Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AddOrderNotifier as AddOrderNotifier
participant SessionNotifier as sessionNotifierProvider
participant Router as Navigation
User->>AddOrderNotifier: Order action triggers<br/>CantDoReason.invalidFiatCurrency
AddOrderNotifier->>AddOrderNotifier: Detect invalidFiatCurrency
AddOrderNotifier->>AddOrderNotifier: Call _cleanupSessionAndNavigateBack()
Note over AddOrderNotifier: Log cleanup action
AddOrderNotifier->>SessionNotifier: Delete session by requestId
SessionNotifier->>SessionNotifier: Session removed
AddOrderNotifier->>Router: Navigate to home ('/')
AddOrderNotifier->>AddOrderNotifier: Invalidate notifier
Router->>User: Display home/order book
sequenceDiagram
participant NotificationService
participant NotificationListenerWidget as Notification Widget
participant Context
participant L10n
NotificationService->>NotificationListenerWidget: CantDo notification received<br/>reason: 'invalid_fiat_currency'
NotificationListenerWidget->>NotificationListenerWidget: Extract reason from payload
NotificationListenerWidget->>NotificationListenerWidget: Call CantDoNotificationMapper.getMessage()
NotificationListenerWidget->>L10n: Resolve invalidFiatCurrency key
L10n->>NotificationListenerWidget: Return localized message
NotificationListenerWidget->>Context: Display error notification<br/>with localized message
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes The changes are straightforward additions with minimal complexity: a single new enum value, localized strings across three language files (repetitive pattern), basic session cleanup logic, and mapping updates. No intricate logic or architectural changes are introduced. Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (6)
🧰 Additional context used📓 Path-based instructions (7)lib/l10n/intl_{en,es,it}.arb📄 CodeRabbit inference engine (CLAUDE.md)
Files:
lib/l10n/*.arb📄 CodeRabbit inference engine (CLAUDE.md)
Files:
lib/**/*.dart📄 CodeRabbit inference engine (CLAUDE.md)
Files:
**/*.dart📄 CodeRabbit inference engine (CLAUDE.md)
Files:
lib/data/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
lib/shared/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
lib/features/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (8)
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 |
grunch
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK
fix #325
Summary by CodeRabbit