[api2] events: add source_conversation_seen event#7784
Merged
Conversation
f7555af to
7c5032b
Compare
legoktm
requested changes
Mar 11, 2026
There was a problem hiding this comment.
Pull request overview
Adds an API2 event intended to let clients mark a whole source conversation as “seen” up to a given interaction_count, reducing the need to send many per-item events for large conversations.
Changes:
- Adds a new API2 event data payload for “conversation seen” with
upper_boundvalidation. - Registers and implements a server-side handler to mark qualifying items as seen.
- Adds an integration test covering OK / AlreadyReported / Gone behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
securedrop/journalist_app/api2/types.py |
Introduces a new event type + payload, and wires it into EVENT_TYPES. |
securedrop/journalist_app/api2/events.py |
Registers the new event handler and implements “mark conversation seen” processing. |
securedrop/tests/test_journalist_api2.py |
Adds test coverage for processing the new event through /api/v2/data. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
8382e52 to
1b7c63d
Compare
1b7c63d to
f424707
Compare
Member
|
test_api2_source_conversation_seen is failing with: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
source_conversation_seenevent that marks all items in a source conversation as seen before a giveninteraction_count. This allows the client to update potentially large conversations with a single event.Test plan
Checklist
This change accounts for: