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

Combine preferences callback and track-changes on defining query #1961

Open
ralfhandl opened this issue Jul 2, 2024 · 5 comments
Open

Combine preferences callback and track-changes on defining query #1961

ralfhandl opened this issue Jul 2, 2024 · 5 comments
Assignees
Labels
Protocol Protocol, URL Conventions V4.02

Comments

@ralfhandl
Copy link
Contributor

Current specification text suggests that preference callback can only be used

This suggests that two requests are necessary for being notified of changes:

  • Send defining query with preference track-changes
  • Send GET request to delta link with preference callback

Allow combining this into one request:

  • Send defining query with both preference track-changes and preference callback
@HeikoTheissen
Copy link
Contributor

It seems problematic that callback is a preference on its own which can appear together with another preference, either respond-async or track-changes. If callback was an attribute of these other preferences, it could appear in both in one request.

@ralfhandl
Copy link
Contributor Author

ralfhandl commented Oct 9, 2024

Alternative 1: Extend current state

Prefer: track-changes

  • return delta link for polling

Prefer: track-changes,callback;url=http://me

  • return delta link, callback on changes

Prefer: track-changes;mode=no-delta-link

  • don't return delta link, kind of useless

Prefer: track-changes;mode=no-delta-link,callback;url=http://me

  • don't return delta link, callback on changes

Problem: can't prefer to have a complicated defining request processed async and get a callback for the async processing and a different callback for the available delta

Alternative 2: Add callback-url attribute to other preferences, optionally deprecate callback preference in combination with these

Prefer: track-changes;callback-url=http://me

  • return delta link, callback on changes

Prefer: track-changes;no-delta

  • don't return delta link, kind of useless

Prefer: track-changes;no-delta;callback-url=http://me

GET /complicated-collection
Prefer: respond-async;callback-url=http://me/initial,track-changes;callback-url=http://me/delta

@ralfhandl
Copy link
Contributor Author

ralfhandl commented Nov 20, 2024

Idea: if service doesn't support callback, respond with Preference-Applied and omit the unsupported callback-url.

Unfortunately not supported by the syntax of Preference-Applied.

@ralfhandl
Copy link
Contributor Author

ralfhandl commented Nov 20, 2024

Add new preferences respond-async-callback and track-changes-callback that can be used combined with the existing and explain all valid combinations.

Note: respond-async is registered without attributes, so we can't (easily) extend it with attributes, which effectively excludes Alternative 2.

@ralfhandl ralfhandl moved this from Open to Resolved in OData TC Nov 20, 2024
@mikepizzo
Copy link
Contributor

I would like to make sure we clarify relationship of the new callback preferences with the existing callback preference.

In particular, is it an error to specify the existing preference with the new preference (which would require the client know which preferences they can provide) or do the new preferences take precedence over the existing preferences (which I think is my preference). And, do we want to deprecate the existing callback preference in favor of the new ones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Protocol Protocol, URL Conventions V4.02
Projects
Status: Open
Development

No branches or pull requests

4 participants