-
Notifications
You must be signed in to change notification settings - Fork 1
Description
stream_feeds: v0.5.0
In the API Explorer response for notification activities of type "comment", the
notification_context.trigger object contains additional comment data.
Example API response:
"notification_context": {
"trigger": {
"type": "comment",
"text": "Andrei Mikhniuk commented on your activity",
"comment": {
"id": "25fb5298-9e32-4449-9719-601febd1eae3",
"user_id": "b7deab7e-398a-4848-b2a3-fef84d0f8391",
"comment": "12"
}
}
}
However, in the Dart package stream_feeds v0.5.0, the NotificationTrigger model only contains:
class NotificationTrigger {
final String text;
final String type;
}
The nested "comment" object is not modeled or deserialized.
Impact
Because the trigger comment payload is missing, it is not possible to retrieve the ID of the comment that triggered the notification. This prevents navigating from a notification item of type "comment" to the corresponding activity comment.
Expected behavior
When trigger.type == "comment", NotificationTrigger should expose the trigger
comment data, at least the comment ID
Actual behavior
Only "type" and "text" are available; the trigger comment information is lost.
Just in case, this data is present in the API response.
Suggested fix
Extend NotificationTrigger with an optional "comment" field (e.g. a minimal model containing id, user_id, and comment) and map it from the API response.