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

Desktop,Mobile,Cli: Include types of synced items in the sync status message #11488

Open
wants to merge 9 commits into
base: dev
Choose a base branch
from

Conversation

personalizedrefrigerator
Copy link
Collaborator

@personalizedrefrigerator personalizedrefrigerator commented Dec 11, 2024

Summary

This pull request implements a feature request from the forum.

Previously, the sync status message would list a large number of deleted "items" after removing old note versions on the sync target. This pull request should make the status message less confusing.

For example, previously, Deleted remote items: 1024 might be shown after deleting 1024 old note versions. With this pull request, Deleted remote: 1024 (note history) would be shown instead.

Note

Users may be experiencing related issues due to the changes from this pull request, which fixed a bug where old revisions were not removed from the sync target.

Notes

  • Currently, tags are listed as other. This is in part to avoid confusion about the different types of tag entities (tag associations and tags).
  • Item types are always joined with commas.
    • This may be incorrect for some locales. Suggestions for how to improve this would be welcome!
  • Originally, this pull request limited the maximum length of the list of item types. The goal was to prevent the status message from becoming too long (and thus shrinking the available space for the notebook list). A truncated message might look like this:
    • Created local: 4. Updated local: 1 (notes). Deleted local: 79 (note history, resourc...). Fetched items: 86/86. Completed: 10/12/2024 22:25 (53s)
      The above message might be confusing. For now, this pull request does not truncate long status messages.

Example status messages

  • After adding a new note:
    • Updated remote: 1 (notes). Fetched items: 2/2. Completed: 10/12/2024 22:19 (3s)
  • After moving a note to the trash:
    • Created remote: 1 (note history). Updated remote: 1 (notes). Completed: 10/12/2024 22:21 (4s)
  • After emptying the trash (permanently deleting 2 notes and a notebook):
    • Deleted remote: 3 (notes, notebooks). Fetched items: 4/4. Completed: 10/12/2024 22:22 (3s)
  • After creating a revision:
    • Created remote: 1 (note history). Fetched items: 2/2. Completed: 10/12/2024 22:28 (3s)
  • After pulling 1 remote item:
    • Created local: 1. Fetched items: 2/2. Completed: 10/12/2024 22:28 (5s)
    • Note: At present, item type doesn't always seem to be available for logged "createLocal" events.
  • An in-progress sync that 1) enables encryption, 2) permanently deletes a notebook/note, and 3) deletes old note versions:
    • Created remote: 3 (note history). Updated remote: 165 (notes, notebooks, resources, note history, other). Deleted remote: 5 (notes, notebooks, note history).

}

if (modifiedItemNames.length > 0) {
return _('%d (%s)', sum, modifiedItemNames.join(', '));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the pull request description, modifiedItemNames.join(', ') isn't ideal for localization purposes.

@personalizedrefrigerator personalizedrefrigerator added the sync sync related issue label Dec 11, 2024
@mrjo118
Copy link
Contributor

mrjo118 commented Dec 14, 2024

Nice work! I thought about proposing something like this, but glad to see this has been suggested and now even been implemented.

I think particularly in the case of deletions, it would be good to have some kind of breakdown which includes the totals for each category. For example, you might delete 1 note but also 20 revisions are deleted, so seeing 'deleted remote: 21 (notes, note history)' is still going to be scary. You could put the number next to each part in the brackets as well, or if you don't want to make the sync summary even more cluttered, then maybe you could log the total of each part within the breakdown, if that is not done already?

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

Successfully merging this pull request may close these issues.

2 participants