-
Notifications
You must be signed in to change notification settings - Fork 16
Fix: Improve subscription management and event handling #127
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
Merged
Merged
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
90619cc
Feat: add subscription pooling to MostroService
chebizarro bcc0248
refactor: simplify order state management and remove unused order act…
chebizarro b78a077
feat: implement subscription manager for centralized Nostr event hand…
chebizarro eda3d92
Bug when selecting the premium or discount for an order
chebizarro 4832686
refactor: redesign trades list UI and improve order state management
chebizarro 87e95ee
refactor: revamp subscription management with session-based subscript…
chebizarro f95e669
refactor: migrate to centralized subscription management system using…
chebizarro 197ca96
refactor: streamline subscription management and improve navigation flow
chebizarro de9a0c3
refactor: remove trades subscription type and related functionality
chebizarro cbf3ae1
Reopen the app to update the status of an order and chat messages.
chebizarro 3e98534
refactor: update mock implementations and add SubscriptionManager moc…
chebizarro 83450c4
feat: add DM action to order states and update trade detail screen ac…
chebizarro 2ddcdfb
refactor: migrate to automatic subscription management using Subscrip…
chebizarro 8c2d58a
refactor: simplify subscription filter logic and remove unused subscr…
chebizarro 3764000
refactor: update mock subscription manager with proper stream handlin…
chebizarro 71834ff
fix: prevent duplicate events in chat and handle unix timestamps corr…
chebizarro 9aeb5f7
Merge branch 'main' into chebizarro/issue57
chebizarro b285968
refactor: add session-based action validation to reactive button widget
chebizarro e568960
Reopen the app to update the status of an order and chat messages.
chebizarro 7b65ede
refactor: clean up notification service by removing unused code and c…
chebizarro 16d8e4b
Merge branch 'main' into chebizarro/issue57
chebizarro 3b0873d
refactor: enhance model validation and error handling across data models
chebizarro cf07cf2
chore: upgrade go_router to v16 and share_plus to v10
chebizarro a218df3
refactor: improve session validation and error handling in models and…
chebizarro 48939f7
Merge branch 'main' into chebizarro/issue57
chebizarro 92ed140
Reopen the app to update the status of an order and chat messages.
chebizarro b003bee
refactor: standardize button text keys across language files
chebizarro c71927d
refactor: simplify event storage and optimize trade filtering logic
chebizarro 455f0de
chore: exclude generated files from analysis and add logging for DM e…
chebizarro c6cdeb1
fix: handle empty sessions and missing shared keys in subscription fi…
chebizarro efe3e4c
feat: unsubscribe all active subscriptions when app enters background…
chebizarro 2a55d83
Reopen the app to update the status of an order and chat messages.
chebizarro c2d6b16
feat: add fetchEvents method to NostrService for async event retrieval
chebizarro 7c447a8
merge upstream changes
chebizarro 77c7d14
chore: remove unused order-related translations from English locale file
chebizarro 150ea82
refactor: standardize done button text and remove unused wallet butto…
chebizarro 82183d5
merge main
chebizarro 950c6c1
fix: update button labels to use shorter translation keys
chebizarro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1 @@ | ||
| class ChatModel { | ||
| final String id; | ||
| final String username; | ||
| final String lastMessage; | ||
| final String timeAgo; | ||
| final bool isUnread; | ||
|
|
||
| ChatModel({ | ||
| required this.id, | ||
| required this.username, | ||
| required this.lastMessage, | ||
| required this.timeAgo, | ||
| this.isUnread = false, | ||
| }); | ||
| } |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
Inconsistent key naming between 'cant_do' and 'cant-do'.
The implementation expects
cant_doas the top-level key (line 11) but looks forcant-dowithin a nested object (line 20). This inconsistency could lead to parsing failures depending on the JSON structure.Consider standardizing on one key format:
} else if (cantDoValue is Map<String, dynamic>) { - final cantDoReason = cantDoValue['cant-do']; + final cantDoReason = cantDoValue['cant_do']; if (cantDoReason == null) { - throw FormatException('Missing required field: cant-do in cant_do object'); + throw FormatException('Missing required field: cant_do in nested object'); }📝 Committable suggestion
🤖 Prompt for AI Agents
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.
This inconsistency exists at the protocol level so changing to one key format will break message parsing
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.
@chebizarro Thank you for the clarification! You're absolutely right - I should not have suggested changing the key naming since it would break protocol compliance. The inconsistency between
cant_doandcant-dois clearly an intentional part of the protocol specification, not a code issue.I withdraw my suggestion as it would introduce a breaking change that would make the implementation incompatible with the protocol.
(´。• ◡ •。`) ♡
✏️ Learnings added
🧠 Learnings used