Files
zpan/spec/events.feature
Jasper Van 5473db9be1 fix(downloads): separate list data from task details (#525)
* fix(downloads): separate list items from task details

* fix(downloads): scope task list to downloader

* fix(downloads): stabilize table data
2026-07-27 10:22:47 -04:00

54 lines
2.1 KiB
Gherkin

Feature: Event stream
The client subscribes to a single authenticated server-sent event stream that
pushes background-job and notification updates, replacing per-resource polling.
@events/auth-required @api
Scenario: The event stream requires authentication
Given an unauthenticated request
When it opens the event stream
Then the API responds 401
@events/stream @api
Scenario: A browser session receives its multiplexed event stream
Given an authenticated user
When they open the global event stream
Then job, notification, and download-task events are streamed to them
@events/api-key-download-tasks @api
Scenario: An authorized organization API key receives only its organization's download tasks
Given an organization API key with remoteDownload read permission
And download tasks exist in its organization and another organization
When it opens the global event stream
Then its organization receives a download-tasks event
And the stream contains no notification, job, or other-organization task data
@events/api-key-permission-denied @api
Scenario: An organization API key without download-task read permission is forbidden
Given an organization API key without remoteDownload read permission
When it opens the event stream with download tasks enabled
Then the API responds 403
@events/api-key-global-stream @api
Scenario: An authorized organization API key uses the global stream without per-page opt-ins
Given an organization API key with remoteDownload read permission
When it opens the global event stream
Then the API responds 200
@events/api-key-invalid @api
Scenario: An invalid API key cannot open the event stream
Given an invalid API key
When it opens the global event stream
Then the API responds 401
@events/abort @api
Scenario: Aborting the request closes the stream
Given an open event stream
When the request is aborted
Then the stream is closed
@events/error-event @api
Scenario: A failing query surfaces as an error event
Given an open event stream
When a domain query fails
Then an error event is emitted