Skip to content

fix(versions): use the mtime Collabora reports instead of the current time - #6221

Open
juliusknorr wants to merge 2 commits into
mainfrom
fix/versions-real-mtime
Open

juliusknorr wants to merge 2 commits into
mainfrom
fix/versions-real-mtime

Conversation

@juliusknorr

@juliusknorr juliusknorr commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Alternative to #6017.

Richdocuments emitted files:node:updated with Date.now() as mtime on every Doc_ModifiedStatus, Action_Save, UI_Save, rename and close. The versions tab then no longer recognizes the real current version: broken preview, and opening it requests files_versions/<file>.v<mtime>, which does not exist (getFile failed in the log).

Fetching the node after Doc_ModifiedStatus is not enough either, since that fires before Collabora uploads to storage, and Action_Save_Resp is not sent for autosaves.

  • Never fake the mtime
  • Use Doc_LastModifiedTime, the storage mtime Collabora gets back from PutFile/CheckFileInfo
  • Fall back to fetching the node on close for Collabora versions that do not send it

Needs the Collabora change forwarding lastmodtime as Doc_LastModifiedTime (https://gerrit.collaboraoffice.com/c/online/+/17024).

Backports: stable33/34 should keep emitting immediately, as their viewer does not reload the editor on files:node:updated.

Intentionally left out: a save Collabora makes while closing lands after the editor is gone, so the emitted mtime can be the one from the save before. Fixing that needs the server to push the new mtime (e.g. via notify_push) to the files app, which then updates the node, independent of the editor.

TODO

  • Collabora change merged

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

… time

The versions tab matches a version against the node's mtime to find the
current one. Emitting Date.now() on every modified status change made
the real current version look like an old one, with a broken preview
and a download pointing at a version file that does not exist.

Take the storage mtime from Doc_LastModifiedTime and fall back to
fetching the node on close for Collabora versions that do not send it.

Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
Assisted-by: ClaudeCode:claude-opus-5-5
Signed-off-by: Julius Knorr <jus@bitgrid.net>
@juliusknorr
juliusknorr marked this pull request as ready for review October 23, 2026 13:08
@juliusknorr
juliusknorr requested a review from elzody as a code owner October 23, 2026 13:08
@juliusknorr

Copy link
Copy Markdown
Member Author

/backport to stable35

@juliusknorr

Copy link
Copy Markdown
Member Author

/backport to stable34

@juliusknorr

Copy link
Copy Markdown
Member Author

/backport to stable33

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reload versions tab after editing/saving in editor

1 participant