Summary
Modification/update times aren't being updated by the beta image editor on iOS and Android.
This causes changes to drawings not to be synced.
It should be fixed by this (merged) pull request. A new beta release should be available soon. Until one is, be aware that drawings may not sync properly.
Preventing data loss on sync
The next time a resource is edited in a way that does update the modification timestamp, that copy of the resource may overwrite other copies without producing conflicts. This is because its timestamp will be newer than all other versions of that drawing, which all have their timestamp set to their creation date.
To prevent edited copies from being lost, you can
- Make a JEX backup (Configuration > Scroll down to "Export" > Export all notes as JEX). This saves the edited — but not correctly synced — drawings to the JEX export file (tested on iOS).
- Alternatively, long-press on a drawing and click "share" to save the modified copies of the drawing externally.
- After the pull request is merged, opening a drawing in the image editor and clicking Save should update the drawing's last modified timestamp. (Make sure that the version you first click "Save" on is the version you want to keep! Incorrect last modified times may prevent conflicting changes from being moved to "Conflicts".)
Original post
Overview
While testing the js-draw
-based beta editor on iOS, I encountered a very strange sync issue that I haven't since been able to reproduce (except for with a single resource).
Interestingly, there seem to now be two files on OneDrive with the resource's UUID, one in the .resources
folder and one with a .md
extension. Edit: This is expected. See comment below.
It would be helpful to know if this is happening for anyone else (and if there's a consistent way to reproduce this for new attachments).
What I did
I attached a new drawing by clicking the "Draw picture" button under the note actions menu. I drew something, then clicked save
, then close
(if I remember correctly).
I then synced my (iOS) device to OneDrive. After that finished, I synced a desktop client to OneDrive. The drawing renders to this:
I then tried editing the drawing on the iOS device and re-syncing. Nothing changed.
Other drawings can be added on the iOS device. After syncing, the other new drawings show up, as expected, on the desktop client.
The markdown for the drawing looks like this:
![Drawing](:/73372e9b8dae434ab2b63b145474cf5e)
If I remove the exclamation mark and click on the link, a dialog shows the error
contextMenu.ts:62 Error: Error: ENOENT: no such file or directory,
lstat '/home/myusername/snap/joplin-desktop/40/.config/joplin-desktop/resources/73372e9b8dae434ab2b63b145474cf5e.svg'.
Path: /home/myusername/snap/joplin-desktop/40/.config/joplin-desktop/resources/73372e9b8dae434ab2b63b145474cf5e.svg
Relevant sections of the log
Most recent logs are first, least recent are last.
10-30T11:14:07: Synchronizer: "Sync: finished: Synchronisation finished [1698689627286]"
10-30T11:14:06: Synchronizer: "Sync: fetchingProcessed: Processing fetched item"
10-30T11:14:06: Synchronizer: "Sync: fetchingProcessed: Processing fetched item"
10-30T11:14:06: Synchronizer: "Sync: fetchingTotal: Fetching delta items from sync target"
10-30T11:14:06: Synchronizer: "BasicDelta: Report: {"timestamp":1698689499640,"older":4073,"newer":2,"equal":0}"
10-30T11:13:53: Synchronizer: "TaskQueue.stop: syncDownload: waiting for tasks to complete: 0"
10-30T11:13:53: Synchronizer: "TaskQueue.stop: syncDownload: Done, waited for 0"
10-30T11:13:53: RevisionService: "maintenance: Done in 110ms"
10-30T11:13:53: RevisionService: "collectRevisions: Created revisions for 0 notes"
10-30T11:13:53: Synchronizer: "Sync: updateRemote: local has changes: Resource: (Local 73372e9b8dae434ab2b63b145474cf5e): (Remote 73372e9b8dae434ab2b63b145474cf5e.md)"
[[...removed...]]
10-30T11:02:53: Synchronizer: "Sync: createRemote: remote does not exist, and local is new and has never been synced: Revision: (Local 380825b6c0624faf8f845b604b292059)"
10-30T11:02:53: Synchronizer: "Sync: updateRemote: local has changes: Resource: (Local 73372e9b8dae434ab2b63b145474cf5e): (Remote 73372e9b8dae434ab2b63b145474cf5e.md)"
10-30T11:02:51: Synchronizer: "Sync: updateRemote: local has changes: Note: (Local d29687d7a54149459086afc2460bc62d): (Remote d29687d7a54149459086afc2460bc62d.md)"
10-30T11:02:49: Synchronizer: "Sync target local info:", "{ [[...removed...]] }"
10-30T11:02:49: Synchronizer: "Sync target is already setup - checking it..."
10-30T11:02:48: "ResourceService::indexNoteResources: Completed"
10-30T11:02:48: Synchronizer: "Indexing resources..."
10-30T11:02:48: "ResourceService::indexNoteResources: Start"
10-30T11:02:48: Synchronizer: "Sync: starting: Starting synchronisation to target 3... supportsAccurateTimestamp = false; supportsMultiPut = false [1698688968730]"
10-30T11:02:48: root: "root.biometrics: biometricsDone", "true"
10-30T11:02:48: root: "root.biometrics: biometricsEnabled", "false"
10-30T11:02:48: root: "root.biometrics: shouldShowMainContent", "true"
10-30T11:02:48: root: "root.biometrics: this.state.sensorInfo", "{"enabled":false,"sensorsHaveChanged":false,"supportedSensors":""}"
10-30T11:02:48: "Preparing scheduled sync"
10-30T11:02:48: "Starting scheduled sync"
10-30T11:02:42: RevisionService: "collectRevisions: Created revisions for 1 notes"
10-30T11:02:42: RevisionService: "maintenance: Done in 124ms"
10-30T11:02:42: root: "root.biometrics: biometricsDone", "true"
10-30T11:02:42: root: "root.biometrics: biometricsEnabled", "false"
10-30T11:02:42: root: "root.biometrics: shouldShowMainContent", "true"
10-30T11:02:42: root: "root.biometrics: this.state.sensorInfo", "{"enabled":false,"sensorsHaveChanged":false,"supportedSensors":""}"
10-30T11:02:42: RevisionService: "maintenance: Starting..."
10-30T11:02:42: RevisionService: "maintenance: Service is enabled"
10-30T11:02:41: screens/Note: "Saved drawing to", "/var/mobile/Containers/Data/Application/D9F01A8F-32DE-4519-AF96-2BA507911084/Documents/73372e9b8dae434ab2b63b145474cf5e.svg"
10-30T11:01:49: "SearchEngine: Updated FTS table in 54ms. Inserted: 1. Deleted: 0"
10-30T11:01:49: "SearchEngine: Updating FTS table..."
10-30T11:01:46: root: "root.biometrics: biometricsDone", "true"
10-30T11:01:46: root: "root.biometrics: biometricsEnabled", "false"
10-30T11:01:46: root: "root.biometrics: shouldShowMainContent", "true"
10-30T11:01:46: root: "root.biometrics: this.state.sensorInfo", "{"enabled":false,"sensorsHaveChanged":false,"supportedSensors":""}"
10-30T11:01:46: Synchronizer: "Total folders: 27"
10-30T11:01:46: Synchronizer: "Total notes: 730"
10-30T11:01:46: Synchronizer: "Total resources: 915"
10-30T11:01:46: Synchronizer: "Operations completed: "
10-30T11:01:46: Synchronizer: "createRemote: 1"
10-30T11:01:46: Synchronizer: "updateRemote: 1"
10-30T11:01:46: Synchronizer: "Sync: finished: Synchronisation finished [1698688901280]"
10-30T11:01:46: Synchronizer: "Processing a path that has already been done: 73372e9b8dae434ab2b63b145474cf5e.md. sync_time was not updated? Remote item has an updated_time in the future?"
10-30T11:01:45: Synchronizer: "Sync: updateRemote: local has changes: Note: (Local d29687d7a54149459086afc2460bc62d): (Remote d29687d7a54149459086afc2460bc62d.md)"
10-30T11:01:43: screens/Note: "Saved drawing to", "/var/mobile/Containers/Data/Application/D9F01A8F-32DE-4519-AF96-2BA507911084/Documents/73372e9b8dae434ab2b63b145474cf5e.svg"
10-30T11:01:43: "ResourceService::deleteOrphanResources:", "[]"
10-30T11:01:43: RevisionService: "maintenance: Done in 110ms"
10-30T11:01:43: "ResourceService::indexNoteResources: Completed"
10-30T11:01:43: RevisionService: "collectRevisions: Created revisions for 0 notes"
10-30T11:01:43: Synchronizer: "Sync: createRemote: remote does not exist, and local is new and has never been synced: Resource: (Local 73372e9b8dae434ab2b63b145474cf5e)"
10-30T11:01:43: root: "root.biometrics: biometricsDone", "true"
This line in the logs seems particularly suspicious: 10-30T11:01:46: Synchronizer: "Processing a path that has already been done: 73372e9b8dae434ab2b63b145474cf5e.md. sync_time was not updated? Remote item has an updated_time in the future?"
Files on OneDrive
Interestingly, there are two files with the same UUID on OneDrive:
File 1: 73372e9b8dae434ab2b63b145474cf5e.md:
id: 73372e9b8dae434ab2b63b145474cf5e
mime:
filename:
created_time:
updated_time: 2023-10-30T18:18:53.595Z
user_created_time:
user_updated_time:
file_extension:
encryption_cipher_text: JED0100002205cb62f8af20624c9e8c9fac86632c6032000384{...REMOVED BEFORE POSTING TO DISCOURSE...}
encryption_applied: 1
encryption_blob_encrypted:
size:
is_shared:
share_id:
master_key_id:
user_data:
blob_updated_time:
type_: 4
The encryption_cipher_text
decrypts to
Drawing
id: 73372e9b8dae434ab2b63b145474cf5e
mime: image/svg+xml
filename:
created_time: 2023-10-30T18:01:43.615Z
updated_time: 2023-10-30T18:18:53.595Z
user_created_time: 2023-10-30T18:01:43.615Z
user_updated_time: 2023-10-30T18:18:53.595Z
file_extension:
encryption_cipher_text:
encryption_applied: 0
encryption_blob_encrypted: 1
size: 0
is_shared: 0
share_id:
master_key_id:
user_data:
blob_updated_time: 1698688903615
type_: 4
File 2: .resources/73372e9b8dae434ab2b63b145474cf5e
JED0100002205cb62f8af20624c9e8c9fac86632c6032