nextcloud / notes

✎ Distraction-free notes and writing
https://apps.nextcloud.com/apps/notes
GNU Affero General Public License v3.0
623 stars 133 forks source link

fix/shared notes #1320

Closed juliusknorr closed 4 months ago

juliusknorr commented 4 months ago

The current backend logic to get or create a notes folder is not ideal as we cannot easily determine if a folder exists because a user has created and set is as notes folder before or if it was manually picked as a notes folder.

To avoid issues with the wrong incoming shared folder being taken as notes folder automatically this PR refactors the logic so that we now no longer store the notes folder in the config with the default value, until it was actually created. That way we know as soon as the config value is set, we no longer need to check for incoming shares on the folder.

Fix https://github.com/nextcloud/notes/issues/1266

juliusknorr commented 4 months ago

/backport to stable4.10

SimeonEhrig commented 4 months ago

@juliushaertl It's working, but I need a small workaround and I'm not sure, if this expected. If I share my folder from my main account to my android account, the shared folder is also named Notes in the android account. In this case, the note app tries to create a new folder ( Notes (2)). If I rename the shared folder in the android account to Notes_Simeon (the main account is not affected) and select it as notes folder in the notes app settings, everything is working. So, is this expected?