Name the to-do's author and time in mobile push payloads
What does this MR do and why?
The gitlab dict of a full-mode mobile push payload (Gitlab::MobilePush::Payload#gitlab_data) carries the todo's identifiers (todo_id, action, the target, note_id) but not who acted or when the todo was raised, which a to-do list row knows.
The GitLab mobile app's review_submitted landing screen picks the reviewer's review out of the merge request's discussions by exactly those two (the API exposes no review grouping). Without them, a tap on the push could only guess at the newest review-shaped activity on the merge request, whoever left it, and showed another reviewer's review for a Duo Code Review to-do.
This MR adds to the full payload:
| Key | Value |
|---|---|
created_at |
the todo's creation time, ISO 8601 with milliseconds |
author_id |
todo.author_id |
author_name |
todo.author_name |
author_username |
the author's username |
author_avatar_url |
the author's absolute avatar URL |
The id-only payload (payload_mode: id_only) stays identifiers only, and the alert text is unchanged. The app reads the new keys when present and falls back to looking the todo up by id otherwise, so no ordering between this MR and the app release is needed.
How to set up and validate locally
- Register a mobile push subscription and have a to-do raised for the user (for example, request a review from them).
- In
Notifications::MobilePush::SendTodoNotificationsService, inspectGitlab::MobilePush::Payload.new(todo).gitlab_datafor the to-do: it now includescreated_atand the fourauthor_*keys. bin/rspec spec/lib/gitlab/mobile_push/payload_spec.rb
MR acceptance checklist
Evaluated against the MR acceptance checklist.