Skip to content

fix(Versions): update version only after save with current mtime - #6017

Open
blizzz wants to merge 1 commit into
mainfrom
fix/noid/version-shenanigans
Open

fix(Versions): update version only after save with current mtime#6017
blizzz wants to merge 1 commit into
mainfrom
fix/noid/version-shenanigans

Conversation

@blizzz

@blizzz blizzz commented Aug 31, 2026

Copy link
Copy Markdown
Member

Summary

  • files_version matches the item's mtime with the node's to consider whether an item is the current one. This often does not match with Date.now() as it does not match real file's mtime
  • fetches the current mtime from the server upon save. This can be avoided, when Collabora also sends the mtime along the Doc_ModifiedStatus message
  • Action_Save and UI_Save actions would trigger updates before the actual save action, meta data cannot be correct at this time
  • There are still edge cases:
    1. The current version is not always detected correctly, leading to "broken" preview image and download link. The image stays until a refresh, the link will work once it turns into a regular version. It is already a lot better.
    2. Sometimes the version generation can take longer (saw it happening once after 2min), in those case the preview and download link do not work. Out of scope here.

Assisted-by: Claude:claude-sonnet-5

Checklist

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

馃弫 Checklist

馃 AI (if applicable)

  • The content of this PR was partly or fully generated using AI

- files_version matches the item's mtime with the node's to consider
  whether an item is the current one. This often does not match with
  Date.now() as it does not match real file's mtime
- fetches the current mtime from the server upon save. This can be avoided,
  when Collabora also sends the mtime along the Doc_ModifiedStatus message
- Action_Save and UI_Save actions would trigger updates before the actual
  save action, meta data cannot be correct at this time
- There are still edge cases:
  1. The current version is not always detected correctly, leading to
     "broken" preview image and download link. The image stays until a
     refresh, the link will work once it turns into a regular version.
     It is already a lot better.
  2. Sometimes the version generation can take longer (saw it happening
     once after 2min), in those case the preview and download link do not
     work. Out of scope here.

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Assisted-by: Claude:claude-sonnet-5
@blizzz blizzz added bug Something isn't working 3. to review Ready to be reviewed labels Aug 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Ready to be reviewed bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant