fix: opening a note saves it again without any edit (#35017)

Opening or leaving a note saved its text to the server even when nothing in it was touched. Its updated time went up, so reopening a folder that still had notes open in its tabs reordered the folder's newest-first Notes list by load order instead of last edit. Opening or leaving a note without editing it no longer saves its text, and edits still save as before.

Fixes #35003
This commit is contained in:
Classic298 authored and GitHub committed 2026-11-25 03:54:33 +04:00
1 parent 02ff1ba72f
commit dfdf060d81
1 file changed
+2
+2
View File
@@ -1158,6 +1158,8 @@ async def document_save_handler(document_id, data, user):
page = document_page(note.data, document_id)
if not isinstance(data.get('content'), dict):
return None
if data['content'] == page['content']:
return note
editor = await Users.get_user_by_id(user['id'])
if not editor or not await has_access_to_note_files(note, get_content_files(data['content']), editor):
raise ValueError('Cannot attach files you cannot access')