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

Having DavObject::etag property writable #22

Open
georgehrke opened this issue Oct 8, 2018 · 2 comments
Open

Having DavObject::etag property writable #22

georgehrke opened this issue Oct 8, 2018 · 2 comments
Labels
1. to develop Accepted and waiting to be taken care of high High priority question Further information is requested

Comments

@georgehrke
Copy link
Member

@skjnldsv Can you please elaborate again why https://github.com/nextcloud/cdav-library/blob/master/src/models/davObject.js#L57 should be writable here?

Etags are only ever generated on the server and can't be set by the client. And updates will only work if the etag in the If-Match header is correct.

Thx :)

@georgehrke georgehrke added 1. to develop Accepted and waiting to be taken care of question Further information is requested labels Oct 8, 2018
@georgehrke georgehrke added this to the 0.0.3 milestone Oct 8, 2018
@skjnldsv
Copy link
Member

Of course :)
Example:

  1. I open a tab with contacts and click the first contact
  2. I open the another one and edit the same contact with a random change
  3. Back on the first tab, edit the contact
  4. A popup will appear stating a change have been detected on the server and you need to click a button to resync the updated contact and that what you did will be discarded (this is a nice ux behaviour, no data loss, clear explanation)
  5. we retrieved the etag on the last sync attempt (denied since etag obsolete) so we can manually update the cdav-contact object to specify the new etag manually and trigger a new fullFetch to update everything :)

@skjnldsv
Copy link
Member

@georgehrke is it clear? 🙈
If you need a precise example, this is exactly here:
https://github.com/nextcloud/contacts/blob/134527baa933af63400c285b362d9ed889abb001/src/store/contacts.js#L281
We then use this conflict saved etag to update the dav scope linked to the vcard and force a ful refresh :)

@skjnldsv skjnldsv added the high High priority label Oct 25, 2018
@georgehrke georgehrke removed this from the 0.0.3 milestone Jan 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. to develop Accepted and waiting to be taken care of high High priority question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants