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

Joplin Server: Add ability to get a sync debug log #9355

Open
personalizedrefrigerator opened this issue Nov 21, 2023 · 2 comments · May be fixed by #9368
Open

Joplin Server: Add ability to get a sync debug log #9355

personalizedrefrigerator opened this issue Nov 21, 2023 · 2 comments · May be fixed by #9368
Labels
backlog We'll get to it... eventually... enhancement Feature requests and code enhancements server Issues related to Joplin Server

Comments

@personalizedrefrigerator
Copy link
Collaborator

personalizedrefrigerator commented Nov 21, 2023

Currently, it's difficult to debug sync issues. A debug log from the server could help with this.

The log could contain the following information:

  • A list of synced notebook IDs
    • Truncated (e.g. first 4 characters)? I don't think keeping note/notebook IDs private is important, but I would like confirmation on this.
  • A list of synced note IDs
    • Also include revisions?
  • A list of synced resource IDs
  • What notes/notebooks would be synchronized on a first sync (output of an empty diff)

Other information that might be helpful to include:

  • Last modified and created timestamps for notes/notebooks
  • More information about the query used to get the diff (see comment)
@personalizedrefrigerator personalizedrefrigerator added enhancement Feature requests and code enhancements high High priority issues server Issues related to Joplin Server labels Nov 21, 2023
@laurent22
Copy link
Owner

For folder and note IDs I think 6 characters would be better to prevent any collision. There's no attempt in general to keep them private since knowing doesn't give access to anything.

By the way I just remembered there's a CLI command that does something similar in command-e2ee.js to check the status of encrypted items on the sync target. The logic might be similar to what you need so you might want to take a look at it

@personalizedrefrigerator
Copy link
Collaborator Author

personalizedrefrigerator commented Nov 21, 2023

It looks like some of this is already possible:

  • joplin-server-url-here/api/items/root/delta?limit=1000000 outputs the result of a delta
  • joplin-server-url-here/api/items/root:id-here.md shows whether id-here was uploaded to the server

I also see that the changes route, a similar feature, was disabled for leading to database locks.

Interestingly, joplin-server-url-here/api/items/root:notebook-id-here.md results in an "item not found" error and joplin-server-url-here/api/items/root/delta?limit=1000000 seems to not include items with item_name matching notebook IDs (at least for the folders I tested). This does not seem to be the case for notes.

The debug report page I've created, so far, seems to share this limitation — notebooks don't show up in the output (notes and resources do).

To see this:

  1. Start a local instance of Joplin Server
  2. Sync to it from a client
  3. Copy the external link to a notebook from that client (e.g. joplin://x-callback-url/openFolder?id=8b4fd3a997ba4260a3cd05495bf0f0bf)
  4. Copy just the notebook ID (e.g. 8b4fd3a997ba4260a3cd05495bf0f0bf)
  5. Open http://localhost:22300/api/items/root/delta?limit=1000000 in a web browser
  6. Search for the notebook ID
  7. Copy a resource ID and search for it
  8. Copy a note ID and search for it

I'm currently trying to debug this.

Edit: Many folders weren't on the server. Clicking "re-upload local data" fixed the issue.

@personalizedrefrigerator personalizedrefrigerator removed the high High priority issues label Dec 21, 2023
@personalizedrefrigerator personalizedrefrigerator added the backlog We'll get to it... eventually... label Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog We'll get to it... eventually... enhancement Feature requests and code enhancements server Issues related to Joplin Server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants