-
Notifications
You must be signed in to change notification settings - Fork 17
feat: implement nostr: scheme deep link support for order discovery #143
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 app_links dependency for cross-platform deep link handling - Configure Android intent filters and iOS URL schemes for nostr: protocol - Implement NIP-19 nevent decoding with TLV parsing in NostrUtils - Add DeepLinkService for processing nostr: URLs and order resolution - Create DeepLinkHandler for app integration and navigation - Extend NostrService with event fetching by ID from specified relays - Add automatic relay management for nevent-specified relays - Implement proper order type detection and route navigation - Support navigation to /take_sell/:orderId and /take_buy/:orderId based on order type - Add comprehensive error handling and user feedback - Include tests for nevent decoding functionality This enables decentralized order discovery through nostr: links that contain NIP-19 nevent references to order events, allowing users to share and access orders across different clients and platforms.
WalkthroughThis change implements deep linking support for the "nostr:" URI scheme across Android and iOS. It introduces platform-specific manifest updates, a new deep link handler, a deep link service for parsing and processing NIP-19/NIP-69 events, utility methods for nevent decoding, and unit tests. The app now navigates to order screens based on incoming nostr links. Changes
Sequence Diagram(s)sequenceDiagram
participant OS as Mobile OS
participant App as Mostro App
participant DeepLinkHandler
participant DeepLinkService
participant NostrService
participant Router as GoRouter
OS->>App: Launch app via nostr: URI
App->>DeepLinkHandler: initialize()
DeepLinkHandler->>DeepLinkService: listen for deep links
DeepLinkService-->>DeepLinkHandler: emits nostr: link
DeepLinkHandler->>DeepLinkService: processNostrLink(url, NostrService)
DeepLinkService->>NostrService: fetchOrderInfoByEventId(eventId, relays)
NostrService-->>DeepLinkService: OrderInfo (id, type)
DeepLinkService-->>DeepLinkHandler: DeepLinkResult.success(OrderInfo)
DeepLinkHandler->>Router: navigateToOrder(OrderInfo)
Router-->>App: Navigates to order screen
Possibly related issues
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
⏰ 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)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 9
🧹 Nitpick comments (1)
lib/services/nostr_service.dart (1)
360-367: Simplify temporary settings creation.You can use the copyWith pattern or spread operator to make this more maintainable.
Consider adding a
copyWithmethod to the Settings class:final tempSettings = settings.copyWith(relays: allRelays);Or if Settings is a data class, you could use:
final tempSettings = Settings( ...settings, relays: allRelays, );
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pubspec.lockis excluded by!**/*.lock
📒 Files selected for processing (9)
android/app/src/main/AndroidManifest.xml(1 hunks)ios/Runner/Info.plist(1 hunks)lib/core/app.dart(5 hunks)lib/core/deep_link_handler.dart(1 hunks)lib/services/deep_link_service.dart(1 hunks)lib/services/nostr_service.dart(2 hunks)lib/shared/utils/nostr_utils.dart(1 hunks)pubspec.yaml(1 hunks)test/utils/nostr_utils_test.dart(1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.dart`: Remove unused imports and dependencies Use `const` constructors where possible
**/*.dart: Remove unused imports and dependencies
Useconstconstructors where possible
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
test/utils/nostr_utils_test.dartlib/core/deep_link_handler.dartlib/core/app.dartlib/services/deep_link_service.dartlib/shared/utils/nostr_utils.dartlib/services/nostr_service.dart
`lib/**/*.dart`: Use `S.of(context).yourKey` for all user-facing strings
lib/**/*.dart: UseS.of(context).yourKeyfor all user-facing strings
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
lib/core/deep_link_handler.dartlib/core/app.dartlib/services/deep_link_service.dartlib/shared/utils/nostr_utils.dartlib/services/nostr_service.dart
🧠 Learnings (7)
pubspec.yaml (1)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to **/*.dart : Remove unused imports and dependencies
test/utils/nostr_utils_test.dart (4)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/data/models/nostr_event.dart : Custom `timeAgoWithLocale()` method is implemented in NostrEvent extension
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/nostr_service.dart:3-4
Timestamp: 2025-05-06T15:46:08.942Z
Learning: The file in dart_nostr library is named "ease.dart" (not "eose.dart" as might be expected), as confirmed by the project maintainer.
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to test/mocks.dart : Mocks are generated using Mockito in `test/mocks.dart`
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, `eventStorageProvider` is exported from `package:mostro_mobile/shared/providers/mostro_service_provider.dart` and not from a separate `event_storage_provider.dart` file.
lib/core/deep_link_handler.dart (1)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Use Riverpod for all state management
lib/core/app.dart (10)
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, Riverpod code generation is used with `@Riverpod` annotations. Providers like `eventStorageProvider` are generated in `.g.dart` files from annotated functions in the main provider files. These providers are accessible by importing the main provider file (e.g., `mostro_service_provider.dart`), not by importing a separate provider file.
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Use Riverpod for all state management
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, `eventStorageProvider` is exported from `package:mostro_mobile/shared/providers/mostro_service_provider.dart` and not from a separate `event_storage_provider.dart` file.
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/**/*.dart : Use `S.of(context).yourKey` for all user-facing strings
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/main.dart : Locales for the timeago package are configured in `main.dart` with `timeago.setLocaleMessages()`
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to **/*.dart : Remove unused imports and dependencies
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Regenerate localization files after ARB modifications by running `dart run build_runner build -d`
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Target zero `flutter analyze` issues
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to test/mocks.dart : Mocks are generated using Mockito in `test/mocks.dart`
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Pass BuildContext to methods that need localization
lib/services/deep_link_service.dart (3)
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, Riverpod code generation is used with `@Riverpod` annotations. Providers like `eventStorageProvider` are generated in `.g.dart` files from annotated functions in the main provider files. These providers are accessible by importing the main provider file (e.g., `mostro_service_provider.dart`), not by importing a separate provider file.
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, `eventStorageProvider` is exported from `package:mostro_mobile/shared/providers/mostro_service_provider.dart` and not from a separate `event_storage_provider.dart` file.
Learnt from: chebizarro
PR: MostroP2P/mobile#110
File: test/notifiers/take_order_notifier_test.dart:72-74
Timestamp: 2025-06-04T19:35:20.209Z
Learning: MostroService methods like takeBuyOrder() and takeSellOrder() return Future<void> and trigger side effects through other mechanisms rather than direct return values. When testing these methods, focus on verifying method calls and testing state changes through the provider system rather than mocking return values.
lib/shared/utils/nostr_utils.dart (2)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/data/models/nostr_event.dart : Custom `timeAgoWithLocale()` method is implemented in NostrEvent extension
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/notifications/notification_service.dart:54-59
Timestamp: 2025-05-08T16:31:29.582Z
Learning: In the Nostr protocol, event.id will never be null in events returned by relay subscriptions, so null safety checks for this property are unnecessary.
lib/services/nostr_service.dart (6)
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/notifications/notification_service.dart:54-59
Timestamp: 2025-05-08T16:31:29.582Z
Learning: In the Nostr protocol, event.id will never be null in events returned by relay subscriptions, so null safety checks for this property are unnecessary.
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/data/models/nostr_event.dart : Custom `timeAgoWithLocale()` method is implemented in NostrEvent extension
Learnt from: chebizarro
PR: MostroP2P/mobile#110
File: test/notifiers/take_order_notifier_test.dart:72-74
Timestamp: 2025-06-04T19:35:20.209Z
Learning: MostroService methods like takeBuyOrder() and takeSellOrder() return Future<void> and trigger side effects through other mechanisms rather than direct return values. When testing these methods, focus on verifying method calls and testing state changes through the provider system rather than mocking return values.
Learnt from: chebizarro
PR: MostroP2P/mobile#127
File: lib/features/order/notfiers/abstract_mostro_notifier.dart:45-54
Timestamp: 2025-06-26T15:03:23.529Z
Learning: In AbstractMostroNotifier, state updates occur for all messages regardless of timestamp to hydrate the OrderNotifier from MostroStorage during sync, while handleEvent is only called for recent messages (within 60 seconds) to prevent re-triggering side effects like notifications and navigation for previously handled messages. This design prevents displaying stale notifications when the app is reopened or brought to the foreground.
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, `eventStorageProvider` is exported from `package:mostro_mobile/shared/providers/mostro_service_provider.dart` and not from a separate `event_storage_provider.dart` file.
Learnt from: chebizarro
PR: MostroP2P/mobile#127
File: lib/data/models/cant_do.dart:10-27
Timestamp: 2025-07-08T05:40:47.527Z
Learning: In the CantDo model parsing in lib/data/models/cant_do.dart, the inconsistent key naming between 'cant_do' (top-level) and 'cant-do' (nested) is required by the protocol specification and should not be changed as it would break message parsing compatibility.
⏰ 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)
- GitHub Check: build
🔇 Additional comments (9)
ios/Runner/Info.plist (1)
56-69: LGTM! Proper iOS deep linking configuration.The URL scheme configuration is correctly implemented following iOS standards. The use of "Editor" role is appropriate for handling nostr URLs.
android/app/src/main/AndroidManifest.xml (1)
27-34: LGTM! Proper Android deep linking configuration.The intent filter is correctly configured for handling nostr URLs. The
autoVerify="true"attribute enables automatic verification of app links.test/utils/nostr_utils_test.dart (1)
1-35: LGTM! Comprehensive test coverage for NostrUtils.The test file provides good coverage of the NostrUtils functionality with appropriate test cases for:
- Nevent decoding with validation of structure and content
- URL validation
- URL parsing with result verification
The hardcoded test data is appropriate for unit testing and the assertions verify both structure and expected values.
lib/core/app.dart (1)
84-84: LGTM! Router caching improves performance.Caching the router instance prevents unnecessary recreation on each build, which is a good performance optimization.
lib/shared/utils/nostr_utils.dart (2)
104-104: Good fix for the bech32 decoding index.The correction to use
result[0]aligns with the comment indicating it returns the data part.
111-170: Well-implemented NIP-19 nevent decoding with proper TLV parsing.The implementation correctly handles:
- Format validation
- TLV structure parsing
- Event ID extraction (32 bytes)
- Multiple relay URLs
- Comprehensive error handling
lib/services/deep_link_service.dart (1)
69-108: Good error handling and separation of concerns.The
processNostrLinkmethod properly validates input, handles errors gracefully, and returns structured results.lib/services/nostr_service.dart (2)
200-256: Well-structured event fetching with proper validation.The method correctly:
- Validates the Nostr service initialization
- Filters for NIP-69 order events (kind 38383)
- Validates event source against configured Mostro public key
- Handles both specific and default relay scenarios
383-390: Excellent error handling with settings restoration.The implementation ensures original relay settings are restored even if an error occurs during fetching. This prevents leaving the service in an inconsistent state.
- Fix curly braces requirement for if statement in key management screen - Update app_links dependency to version 6.4.0 for improved compatibility
- Format all Dart files according to standard style guidelines - Update localization files with proper formatting - Ensure consistent code style across the project
flag changed to false, the default value (true) can break third-party plugins like app_links
- Convert static class to instance-based service with dependency injection - Add constructor that accepts Ref parameter for accessing providers - Remove static keywords from all fields and methods - Create deepLinkHandlerProvider with automatic disposal handling - Update app.dart to use provider instead of static calls - Improve testability and align with Riverpod patterns - Maintain clean lifecycle management through ref.onDispose
- Refactor DeepLinkService from static to instance-based implementation - Add proper error handling to deep link initialization in app.dart - Implement localized error messages for deep link operations - Fix BuildContext async usage warnings in DeepLinkHandler - Add retry mechanism for failed deep link initialization - Align service architecture with Riverpod dependency injection patterns Features: - New localization keys: unsupportedLinkFormat, failedToOpenLink, failedToLoadOrder, failedToOpenOrder - Instance-based DeepLinkService with proper disposal through provider - Enhanced error handling and logging for deep link operations - Improved code maintainability and testability
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.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
lib/core/app.dart(5 hunks)lib/core/deep_link_handler.dart(1 hunks)lib/l10n/intl_en.arb(1 hunks)lib/l10n/intl_es.arb(1 hunks)lib/l10n/intl_it.arb(1 hunks)lib/services/deep_link_service.dart(1 hunks)test/mocks.mocks.dart(1 hunks)test/services/mostro_service_test.mocks.dart(4 hunks)
✅ Files skipped from review due to trivial changes (1)
- test/mocks.mocks.dart
🚧 Files skipped from review as they are similar to previous changes (4)
- lib/l10n/intl_en.arb
- lib/core/app.dart
- lib/core/deep_link_handler.dart
- lib/services/deep_link_service.dart
🧰 Additional context used
📓 Path-based instructions (3)
`**/*.dart`: Remove unused imports and dependencies Use `const` constructors where possible
**/*.dart: Remove unused imports and dependencies
Useconstconstructors where possible
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
test/services/mostro_service_test.mocks.dart
`lib/l10n/intl_{en,es,it}.arb`: Add new localization keys to all three ARB files (en, es, it)
lib/l10n/intl_{en,es,it}.arb: Add new localization keys to all three ARB files (en, es, it)
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
lib/l10n/intl_es.arblib/l10n/intl_it.arb
`lib/l10n/*.arb`: Use proper ARB metadata for strings with parameters
lib/l10n/*.arb: Use proper ARB metadata for strings with parameters
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
lib/l10n/intl_es.arblib/l10n/intl_it.arb
🧠 Learnings (3)
test/services/mostro_service_test.mocks.dart (9)
Learnt from: chebizarro
PR: MostroP2P/mobile#110
File: test/notifiers/take_order_notifier_test.dart:72-74
Timestamp: 2025-06-04T19:35:20.209Z
Learning: MostroService methods like takeBuyOrder() and takeSellOrder() return Future<void> and trigger side effects through other mechanisms rather than direct return values. When testing these methods, focus on verifying method calls and testing state changes through the provider system rather than mocking return values.
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to test/mocks.dart : Mocks are generated using Mockito in `test/mocks.dart`
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, `eventStorageProvider` is exported from `package:mostro_mobile/shared/providers/mostro_service_provider.dart` and not from a separate `event_storage_provider.dart` file.
Learnt from: chebizarro
PR: MostroP2P/mobile#127
File: lib/features/order/notfiers/abstract_mostro_notifier.dart:45-54
Timestamp: 2025-06-26T15:03:23.529Z
Learning: In AbstractMostroNotifier, state updates occur for all messages regardless of timestamp to hydrate the OrderNotifier from MostroStorage during sync, while handleEvent is only called for recent messages (within 60 seconds) to prevent re-triggering side effects like notifications and navigation for previously handled messages. This design prevents displaying stale notifications when the app is reopened or brought to the foreground.
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/data/models/nostr_event.dart : Custom `timeAgoWithLocale()` method is implemented in NostrEvent extension
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/notifications/notification_service.dart:54-59
Timestamp: 2025-05-08T16:31:29.582Z
Learning: In the Nostr protocol, event.id will never be null in events returned by relay subscriptions, so null safety checks for this property are unnecessary.
Learnt from: chebizarro
PR: MostroP2P/mobile#74
File: lib/services/mostro_service.dart:70-76
Timestamp: 2025-05-06T15:49:26.443Z
Learning: In the Mostro Mobile codebase, Riverpod code generation is used with `@Riverpod` annotations. Providers like `eventStorageProvider` are generated in `.g.dart` files from annotated functions in the main provider files. These providers are accessible by importing the main provider file (e.g., `mostro_service_provider.dart`), not by importing a separate provider file.
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Use Riverpod for all state management
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to **/*.dart : Remove unused imports and dependencies
lib/l10n/intl_es.arb (4)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Add new localization keys to all three ARB files (en, es, it)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/l10n/*.arb : Use proper ARB metadata for strings with parameters
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Test localization changes in all supported languages
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Regenerate localization files after ARB modifications by running `dart run build_runner build -d`
lib/l10n/intl_it.arb (2)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/l10n/intl_{en,es,it}.arb : Add new localization keys to all three ARB files (en, es, it)
Learnt from: CR
PR: MostroP2P/mobile#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-08T17:55:04.549Z
Learning: Applies to lib/l10n/*.arb : Use proper ARB metadata for strings with parameters
🪛 RuboCop (1.75.5)
lib/l10n/intl_es.arb
[warning] 415-415: Duplicated key in hash literal.
(Lint/DuplicateHashKey)
lib/l10n/intl_it.arb
[warning] 415-415: Duplicated key in hash literal.
(Lint/DuplicateHashKey)
⏰ 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)
- GitHub Check: build
🔇 Additional comments (7)
test/services/mostro_service_test.mocks.dart (4)
13-20: Import updates look good for deep link functionality.The new imports properly support the deep link functionality with consistent alias usage throughout the file.
409-423: New mock method for event fetching is well-implemented.The
fetchEventByIdmethod mock correctly returnsFuture<Order?>and accepts optional relay specification, which aligns with the deep link processing requirements.
445-445: Import alias updates are correctly applied.The
MockSessionNotifierclass and its methods have been properly updated to use the new import aliases (_i12,_i13,_i14) consistently throughout the file.Also applies to: 527-527, 657-657
425-439: OrderInfo definition verifiedThe
OrderInfoclass is properly declared inlib/services/deep_link_service.dartwith the expected fields and constructor. No further changes are needed.lib/l10n/intl_it.arb (2)
414-414: LGTM - Deep link localization strings are well-crafted.The Italian translations for the deep link functionality are clear and appropriate:
- Loading state message is properly translated
- Error messages are user-friendly and descriptive
- No ARB metadata needed as these strings don't contain parameters
Also applies to: 416-419
414-419: All new deep link localization keys are present in all language files.I’ve verified that the following keys are defined in lib/l10n/intl_en.arb, intl_es.arb, and intl_it.arb:
- loadingOrder
- unsupportedLinkFormat
- failedToOpenLink
- failedToLoadOrder
- failedToOpenOrder
No further additions are needed.
lib/l10n/intl_es.arb (1)
414-414: Localization keys present in all ARB filesAll new deep-link localization keys (
loadingOrder,unsupportedLinkFormat,failedToOpenLink,failedToLoadOrder,failedToOpenOrder) are already added to:
- lib/l10n/intl_en.arb
- lib/l10n/intl_es.arb
- lib/l10n/intl_it.arb
Please regenerate the localization outputs by running:
dart run build_runner build -dThis will update the generated files under
lib/generated/. Do not edit those generated files manually—commit them once the build completes.
| "chooseLanguageDescription": "Scegli la tua lingua preferita o usa il predefinito di sistema", | ||
| "done": "FATTO" | ||
| "loadingOrder": "Caricamento ordine...", | ||
| "done": "FATTO", |
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.
Fix duplicate key definition.
The key "done" is already defined at line 131 with the value "Fatto", but it's being redefined here with "FATTO". This will cause the first definition to be overwritten.
Choose one of these solutions:
- Remove the duplicate entry if line 131's definition is sufficient
- Rename this key to something more specific like
"deepLinkDone"if a different value is needed for deep link contexts
- "done": "FATTO",
+ "deepLinkDone": "FATTO",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "done": "FATTO", | |
| - "done": "FATTO", | |
| + "deepLinkDone": "FATTO", |
🧰 Tools
🪛 RuboCop (1.75.5)
[warning] 415-415: Duplicated key in hash literal.
(Lint/DuplicateHashKey)
🤖 Prompt for AI Agents
In lib/l10n/intl_it.arb at line 415, there is a duplicate key "done" which is
already defined at line 131. To fix this, either remove the duplicate entry at
line 415 if the original value is sufficient, or rename the key at line 415 to a
more specific name like "deepLinkDone" if a different value is required for a
distinct context.
| "chooseLanguageDescription": "Elige tu idioma preferido o usa el predeterminado del sistema", | ||
| "done": "HECHO" | ||
| "loadingOrder": "Cargando orden...", | ||
| "done": "HECHO", |
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.
Fix duplicate key error.
The key "done" already exists at line 131 with value "Hecho". This duplicate key will cause issues and needs to be resolved.
Either remove this duplicate entry or rename it to a more specific key like "deepLinkDone" if it serves a different purpose in the deep link context.
- "done": "HECHO",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "done": "HECHO", | |
| "loadingOrder": "Cargando orden...", | |
| - "done": "HECHO", | |
| "unsupportedLinkFormat": "Formato de enlace no compatible", | |
| "failedToOpenLink": "Error al abrir el enlace", | |
| "failedToLoadOrder": "Error al cargar la orden", | |
| "failedToOpenOrder": "Error al abrir la orden" |
🧰 Tools
🪛 RuboCop (1.75.5)
[warning] 415-415: Duplicated key in hash literal.
(Lint/DuplicateHashKey)
🤖 Prompt for AI Agents
In lib/l10n/intl_es.arb at line 415, there is a duplicate key "done" which
already exists at line 131. To fix this, either remove the duplicate entry at
line 415 or rename it to a unique key such as "deepLinkDone" if it represents a
different context. Ensure no duplicate keys remain in the file to prevent
conflicts.
- Remove redundant 'must_be_immutable' ignore directive - File-level ignore already covers this case
This enables decentralized order discovery through nostr: links that contain NIP-19 nevent references to order events, allowing users to share and access orders across different clients and platforms.
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores
app_linksdependency to enable deep link handling.