Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot undo moving or copying synced clippings/folders after reloading Synced Clippings folder #384

Closed
aecreations opened this issue May 29, 2022 · 5 comments
Assignees

Comments

@aecreations
Copy link
Owner

aecreations commented May 29, 2022

Clippings 6.3.5

When the Synced Clippings folder is reloaded, the synced items are purged and reloaded from the sync file. This means that synced items are assigned new IDs in the IndexedDB database. But the undo and redo stacks still hold the old IDs of the synced items before the reload and purge, which causes the Undo and Redo actions to fail.

A temporary fix will be implemented for Clippings 6.3 - added error handling when the clipping or folder is invalid when editing. But a better fix is needed.

@aecreations aecreations added this to the 6.4 San Clemente milestone May 29, 2022
@aecreations aecreations self-assigned this May 29, 2022
aecreations added a commit that referenced this issue Jun 11, 2022
@aecreations
Copy link
Owner Author

Not yet fully fixed. Still need to handle:

  1. Creation of synced clippings and folders from Clippings Manager and the New Clipping dialog
  2. Removing all source URLs in Clippings Manager
  3. Upgrading from previous versions - all synced items need to be populated with static/synced IDs

Also, the static/synced IDs should be GUIDs, not random numbers. This change will ensure that synced items are unique across different instances of Clippings.

aecreations added a commit that referenced this issue Jun 12, 2022
…er reloading Synced Clippings folder

(part of issue #384)
aecreations added a commit that referenced this issue Jun 12, 2022
@aecreations
Copy link
Owner Author

If creating a new clipping from the New Clipping dialog, reloading the Synced Clippings folder from Clippings Manager should be disabled until the user dismisses the New Clipping dialog.

This will prevent errors due to the IDs of synced folders being changed when the sync data is reloaded and the IndexedDB data for them is refreshed.

@aecreations
Copy link
Owner Author

Remaining work to be deferred to after 6.4 beta 1:

  1. Handling undo/redo of removing all source URLs in Clippings Manager
  2. Temporarily disable reloading the Synced Clippings folder from Clippings Manager until the user dismisses the New Clipping dialog

@aecreations
Copy link
Owner Author

Still not fully fixed. Steps to repro:

  1. Select a clipping (or folder) in a sync folder and move it to the root folder, outside the Synced Clippings folder
  2. Reload the Synced Clippings folder
  3. Click Undo

Result: The move from step 1 is not undone.

aecreations added a commit that referenced this issue Jun 16, 2022
aecreations added a commit that referenced this issue Jun 18, 2022
aecreations added a commit that referenced this issue Jun 18, 2022
…oading Synced Clippings folder

(part of issue #384)
aecreations added a commit that referenced this issue Jun 18, 2022
…after reloading Synced Clippings folder

(part of issue #384)
@aecreations
Copy link
Owner Author

Despite these fixes, there are still caveats with undoing most Clippings Manager actions with synced items after reloading the Synced Clippings folder. Undo and redo may not work if the parent folder of a synced item was deleted or moved out of the Synced Clippings folder. Undoing or redoing removal of all source URLs will silently fail (no exceptions thrown) if the affected synced items were changed.

Trying to catch all these edge cases runs the risk of added complexity to Clippings Manager, as well as code bloat, making it harder to debug and maintain. I have decided to leave it as it is for now, and will revisit if there is user demand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant