-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
Priority: MediumenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers
Description
Summary
The protocol documentation (added in #527) documents too-many-requests as a supported CantDo reason, but the mobile app does not implement it.
Problem
If the Mostro server sends a CantDo message with reason too-many-requests, the following failures occur:
CantDoReasonenum (lib/data/models/enums/cant_do_reason.dart) has notooManyRequestsvariant.CantDoReason.fromString()will throw anArgumentErrorfor the unrecognized value, causingCantDo.fromJson()to fail with aFormatException.CantDoNotificationMapper._messageMap(lib/shared/widgets/notification_listener_widget.dart) has no entry for'too_many_requests', so no user-friendly message would be shown even if parsing succeeded.
Expected Fix
- Add a
tooManyRequestsvariant to theCantDoReasonenum inlib/data/models/enums/cant_do_reason.dart. - Ensure
CantDoReason.fromString()recognizes the"too_many_requests"string. - Add a corresponding entry for
'too_many_requests'inCantDoNotificationMapper._messageMap(lib/shared/widgets/notification_listener_widget.dart) with an appropriate user-facing message (e.g., "You have exceeded the allowed request rate. Please try again later.").
References
- Identified in PR Replace the outdated protocol documentation with the most up-to-date version #527 (comment: Replace the outdated protocol documentation with the most up-to-date version #527 (comment))
- Protocol docs:
docs/protocol/message_suggestions_for_actions.mdanddocs/protocol/orders.md
/cc @Catrya
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Priority: MediumenhancementNew feature or requestNew feature or requestgood first issueGood for newcomersGood for newcomers