Skip to content

Allow 404s within a Subscription #110

@toomim

Description

@toomim

In existing HTTP, if a resource doesn't exist, the server responds with a 404 not found and ends the connection. A resource that exists can be deleted with the DELETE method, and a non-existent resource can be created with a PUT or POST.

Braid adds subscription to HTTP, and it'd be nice to subscribe to a resource and be notified when it comes into existence, and when it's deleted, in addition to when it changes. However, subscriptions return a 209 status code, and we have no way to send a 404 within a subscription to reflect that the resource disappeared.

I see two high-level options here:

  1. We find a way to express a "this resource does not exist" update over a subscription
  2. We require that subscriptions only work on resources that exist, and end as soon as a resource is deleted

I'm in favor of (1), but it does require us to invent a new syntax for embedding "resource has been deleted" within a subscription response. Perhaps we can send a header like :status: 404, similar to how HTTP2 represents a status code as a pseudo-header.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions