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

Consider splitting /changes#changed response into "created" and "updated" #213

Closed
neilj opened this issue Jun 12, 2018 · 0 comments
Closed

Comments

@neilj
Copy link
Member

neilj commented Jun 12, 2018

Pending conclusion on mailing list discussion.

I see the following advantages:

  • The client receives more information, so has more flexibility to implement strategies such as always fetching new messages in the same request but delaying fetching updates until the next round trip (and thus can omit fetching these at all if it has a partial cache and the changes are for messages it doesn't have cached anyway).
  • It mirrors the /set create, update, destroy distinction, which I think makes it more consistent and easier to understand.
  • Some APIs like Core Data are more efficient if you don't have to check whether you already know about an id to decide whether it's a create or update
  • You can use this to easily check for ids you care about for notifications (new message deliveries), and ignore those that are just changed.

and disadvantages:

  • The server must store more state in order to calculate this; for example, if using a modseq system, it now needs to store a created modseq as well as a modified modseq.
  • You need two Email/get back-references if you want to fetch both updates and new messages in the single request. This could be less efficient for the server to process and adds syntax overhead in both directions. The server could certainly make this pretty much as efficient to process by detecting successive /get calls and processing them together (so it keeps caches open rather than closing between method calls etc.), but this does add complexity.
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

1 participant