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

Add a file in sync target to warn user that they shouldn't open any file #9997

Open
laurent22 opened this issue Feb 25, 2024 · 1 comment
Open
Labels
enhancement Feature requests and code enhancements high High priority issues sync sync related issue v3.0

Comments

@laurent22
Copy link
Owner

Opening any file, even without changing it, on a Nextcloud sync target is going to corrupt it (See #9887).

To try to prevent the user from doing this we would like to add a file that appears at the top of the list, named something very visible such _⚠️_IMPORTANT_READ_FIRST_⚠️_.md. It would be automatically created when the sync target is initialised and should also be added to existing sync targets. It contains some information as to why these files should not be opened.

@laurent22 laurent22 added enhancement Feature requests and code enhancements sync sync related issue high High priority issues v3.0 labels Feb 25, 2024
@RadCod3
Copy link
Contributor

RadCod3 commented Mar 2, 2024

Hi, I've been working on this and managed to figure out how to add a file to Nextcloud targets. However, I needed some clarifications.

Here is the change I made: RadCod3@59167b3

This modification enables the addition of a file to a Nextcloud target by checking if it has the warning file and adding it if it doesn't. I observed that when connecting a different Joplin client to the sync remote, the console shows the delta algorithm finding 4 new items. These items in the Nextcloud include the warning file, one for a note, one for a notebook (?), and the info.json file. The sync fetches all four of these files, but the warning file doesn't appear in the notes section of the Joplin app. I believe this is what we need, but I'm curious as to why it was filtered. Could it be related to the file not having a footer with id, parent_id, etc.?

Regarding what to add to the warning file, how does the following look?

THIS WAS CREATED AUTOMATICALLY BY JOPLIN. 

# **PLEASE DO NOT EDIT ANY FILES CREATED BY JOPLIN USING THE NEXTCLOUD TEXT EDITOR AS IT CORRUPTS THE FILES.**

FOR MORE INFORMATION ABOUT THIS ISSUE, PLEASE REFER TO THE FOLLOWING LINK: 
[ Nextcloud sync: Very easy to cause data corruption with Nextcloud's rich text editor #9887 ]
(https://github.com/laurent22/joplin/issues/9887)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests and code enhancements high High priority issues sync sync related issue v3.0
Projects
None yet
Development

No branches or pull requests

2 participants