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:
CantDoReason enum (lib/data/models/enums/cant_do_reason.dart) has no tooManyRequests variant.
CantDoReason.fromString() will throw an ArgumentError for the unrecognized value, causing CantDo.fromJson() to fail with a FormatException.
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
tooManyRequests variant to the CantDoReason enum in lib/data/models/enums/cant_do_reason.dart.
- Ensure
CantDoReason.fromString() recognizes the "too_many_requests" string.
- Add a corresponding entry for
'too_many_requests' in CantDoNotificationMapper._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
/cc @Catrya
Summary
The protocol documentation (added in #527) documents
too-many-requestsas a supportedCantDoreason, but the mobile app does not implement it.Problem
If the Mostro server sends a
CantDomessage with reasontoo-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
tooManyRequestsvariant to theCantDoReasonenum inlib/data/models/enums/cant_do_reason.dart.CantDoReason.fromString()recognizes the"too_many_requests"string.'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
docs/protocol/message_suggestions_for_actions.mdanddocs/protocol/orders.md/cc @Catrya