Skip to content

Change parent etag when file metadata changes #16589

Closed

Description

@PVince81

Whenever the following attributes would change as a result of file metadata change, the etag of the parent folder must be changed:

Activity

  1. added this to the backlog milestone on May 27, 2015
  2. PVince81 commented on May 28, 2015

    @PVince81
    ContributorAuthor
  3. PVince81 commented on Oct 10, 2016

    @PVince81
    ContributorAuthor

    This would be required if we really want the etag to represent a fixed state for folders, also for implementing PROPFIND proxy/caching. @DeepDiver1975 @butonic

  4. PVince81 commented on Oct 10, 2016

    @PVince81
    ContributorAuthor
    • oc:share-types ? (when new outgoing shares are created)
  5. PVince81 commented on Oct 24, 2017

    @PVince81
    ContributorAuthor

    Turns out that changing etag for parent when outgoing shares are created/modified would be important for the desktop client to catch the changes for the overlay icons.

  6. modified the milestones: backlog, triage on Oct 24, 2017
  7. PVince81 commented on Mar 23, 2018

    @PVince81
    ContributorAuthor

    it will be even more useful to detect permission changes and other future metadata like X-bit

    cc @moscicki

  8. felix-schwarz commented on May 15, 2019

    @felix-schwarz

    The lack of any indication of meta data changes has several implications for the new iOS client:

    Favorites

    Changing Favorites doesn't leave any trace in the ETag, so won't be picked up by the periodic scan for changes (using a PROPFIND with depth 0 on root).

    For the iOS client that means that favorite information will only be accurate for:

    • items whose favorite status didn't change since they were last returned by a PROPFIND
    • items whose favorite status was changed through the new iOS app on the same device (in which case the iOS app updates its metadata locally as well)

    It will not be accurate for items whose favorite status was changed by any other means (i.e. web UI, other device) after they were last returned as part of a PROPFIND response.

    Impact:

    • we can currently not implement a view showing all favorited items.

    Sharing

    Creating, editing or removing a share doesn't leave any trace in the ETag either, so won't be picked up by the periodic scan for changes (using a PROPFIND with depth 0 on root).

    We currently try to avoid inconsistencies for the user as much as possible by always performing a depth 1 PROPFIND when a user navigates to a folder - and a depth 0 PROPFIND on items that the user performed any sharing related actions via the app.

    However, if the user adds a share to an item via the web UI for a folder they currently view, the change will not be reflected until the user either pulls down to refresh or navigates out of the folder and back into it.

    Impact:

    • we have to do a full depth 1 PROPFIND on every directory the user enters. I'd have loved to do just a depth 0 PROPFIND here instead, and only perform a depth 1 PROPFIND if any indication of changes was found, boosting performance and saving on CPU, battery and bandwidth.
    • sharing status of items may not always be presented accurately

    Related issue: #34666

    Change detection

    Currently, to find changed items in a PROPFIND response, the new iOS app needs to compare

    • ETag to detect file content changes
    • d:href to detect file name changes
    • oc:share-types to detect changes to sharing information
    • oc:permissions to detect changes to permissions
    • oc:favorite to detect changes to the favorite status

    It'd be great to streamline this.

    Impact:

    • code to detect changes is more complex than necessary and - due to lack of documentation - possibly incomplete

    Proposal

    A solution could be the introduction of a new metadata ETag – let's call it the METag:

    • it would change for a file once its favorite status, permissions, name or sharing information has changed.
    • METag changes of files would propagate to parent directories all the way up to the root directory - just like the current ETags do.

    Benefits:

    • a single PROPFIND with depth 0 on the root directory is sufficient to detect any changes
    • minimized the number of PROPFINDs with depth 1 needed to bring locally cached metadata in sync with the latest metadata changes on the server
    • a single attribute to check for clients to see if there has been any metadata change to an item, rather than having to compare a (possibly growing) number of attributes.
  9. butonic commented on Mar 11, 2021

    @butonic
    Contributor

    currently our etag changes also for metadata changes. we could introduce a ctag, which would align with the msgraph definitions:

    Property Type Description
    cTag String An eTag for the content of the item. This eTag is not changed if only the metadata is changed. Note This property is not returned if the item is a folder. Read-only.
    eTag String eTag for the entire item (metadata + content). Read-only.
  10. stale commented on Sep 20, 2021

    @stale

    This issue has been automatically closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions