Skip to content

isCollectionDirty

isCollectionDirty

detect if the collection have changed

const { isDirty, newCtag } = await isCollectionDirty({
collection: calendars[0],
headers: {
authorization: 'Basic x0C9uFWd9Vz8OwS0DEAtkAlj',
},
});

Arguments

  • collection required, DAVCollection to detect
  • headers request headers
  • headersToExclude array of keys of the headers you want to exclude
  • fetchOptions options to pass to underlying fetch function

Return Value

  • isDirty a boolean indicate if the collection is dirty
  • newCtag the remote ctag, or undefined when the server does not provide one. An unavailable ctag means isDirty: true and basic sync fetches a complete snapshot.

Behavior

use PROPFIND to fetch new ctag of the collection and compare it with current ctag, if the ctag changed, it means collection changed.