Skip to content

[Bug]: Overwriting a file within the same second does not alter the etag #63994

Description

@max-nextcloud

⚠️ This issue respects the following points: ⚠️

  • This is not a troubleshooting question, general support matter, or webserver/proxy problem, but likely a bug (if unsure, ask the Community Help Forum).
  • This issue is not already reported on Github OR solved at the Community Help Forum (I've searched!).
  • I'm using a maintained major version of Nextcloud Server and tested against the latest patch level. (Supported major versions and current patch levels).
  • I agree to follow Nextcloud's Code of Conduct.
  • I've tried my best to provide clear reproduction steps that someone unfamiliar with this bug could use to reproduce it.

Bug description

I recently investigated test failures in text and it turned out they were due to etags not getting updated if the same file is written twice in the same second with different content. Salvatore investigated and found:

The etag update on the cache is skipped if the mtime did not change, and the precision for that is seconds (unix timestamp).

Steps to reproduce

  1. Login
  2. Upload one file
  3. Upload another file to the same location within the same second.

Originally found with https://github.com/nextcloud/text/blob/cb19d998ed8132e20da6c17085ed333bcd6b32a5/playwright/e2e/propfind.spec.ts#L25

I will add a playwright test that triggers this on server itself.

Expected behavior

Etag changes when the file is overwritten.

Nextcloud Server Info

Using https://github.com/nextcloud-libraries/nextcloud-e2e-test-server with the default setup. text and viewer app installed.

Activity

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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions