Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Observation: Revisit MUST on Observe in successful notifications #20

Open
chrysn opened this issue Feb 21, 2022 · 2 comments
Open

Observation: Revisit MUST on Observe in successful notifications #20

chrysn opened this issue Feb 21, 2022 · 2 comments

Comments

@chrysn
Copy link
Member

chrysn commented Feb 21, 2022

Current RFC7641 says that "A 2.xx notification MUST include an Observe Option with a sequence number".

If it ever gets an overhaul, I'd consider dropping this in favor of the more general statement that any non-Observe response is ordered after any numbered observe response. That is compatible with the current semantics on unsuccessful responses, but allows for volatile-but-stabilizing resources to send notifications like "Observe: N, Max-Age: 20" several times, until eventually sending "Max-Age: 65535" indicating that this resource has converged. (Think observing the location indicated by a POST request for a long-running process).

In terms of compatibility with existing implementations, I think it'll be fine: A strict client would treat it as an error, just as it'd treat the 5.03 that is currently the best the server can do to say that it doesn't want to keep this observation around any more.

@cabo
Copy link
Member

cabo commented Feb 21, 2022

Nice!

Where should this go into the document?
Should we have a section "Opportunities for small fixes and improvements" or some such?

@chrysn
Copy link
Member Author

chrysn commented Feb 21, 2022

I think the structure of RFC section and component subsection (here: "RFC 7641" / "4.2: Notifications") fits here as well.

Text could be:

RFC 7641 requires that every successful notification "MUST" have an observe option.

For response reordering (which generally relies on the sequence number), the response without an Observe option is ordered after all notifications that have an Observe option. This is consistent with the handling of error responses, which already do not carry an Observe option and are also final. It is RECOMMENDED that this notification is sent as a confirmable message on transports that make such a distinction.

This is primarily useful for for resources that are volatile for some time and then converge to a final state (e.g., the state of long-running processes triggered by a POST request). When the resource reaches that state, there is no use in keeping an observation around, but also no reason to send a notification of an error state. For these notifications it is useful to send a long Max-Age. Clients generally may fall back to polling when observation fails; the long Max-Age ensures that they take their time before polling again.

@cabo cabo transferred this issue from core-wg/corrclar-old Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants