[Beta Test] Notebook Share problems - "Unshare" & "Leave" my own notebook

  • Joplin 2.6.2 Desktop on Windows 10 Pro x64 (21H2) - Virtual Machine
  • Joplin installed "only for me" with no plugins or customisation. All settings default.
  • Joplin Server 2.6.11 (Official Docker image) on Ubuntu 20.04 - Virtual Machine

I was testing notebook sharing and tried to share a notebook with a user whose "Basic" account did not allow it. After entering the mail address and pressing "share" the warning was displayed and the only option was to "Close" the dialog. However if I waited and Joplin synced in the background another option to "Unshare" appeared when the sync started.

If "Unshare" is selected the share marker is removed from the notebook but from then on no notebooks can be shared until Joplin is restarted. An email address cannot be typed into the field on the "Share notebook" dialog.

If "Close" is selected the notebook shows the share icon even though there is no actual share (which I believe has always been the case). However right-clicking on the notebook does not give access to the Share option again. It is replaced by the "Leave" option, even though it is my notebook. Leaving the notebook causes it to be deleted and if Joplin syncs there is a message "Error: Could not find share with ID:...". Subsequent syncs are without errors. If the leave option is not selected and Joplin syncs, the right-click "Share notebook" option returns, replacing the leave option.

I tried this several times and the problems were consistent. However, being an idiot, I nuked the VMs before saving the logs.

Thanks for the detailed bug report. I was able to replicate this and can fix it:

But I couldn't replicate this:

If "Unshare" is selected the share marker is removed from the notebook but from then on no notebooks can be shared until Joplin is restarted. An email address cannot be typed into the field on the "Share notebook" dialog.

Does it always happen for you, and if so could you provide any error from the log or console? One thing is that the option to share is going to be disabled during sync so perhaps that's what it was? (it would display "synchronising..." in the dialog)

I will give it a try but I need to set-up the VMs again!

Could you duplicate the magically appearing "unshare" button?

The "unshare" button I was referring to was the one that is initially not present but, if the share dialog is not closed, then suddenly appears to the left of "Close" after an automatic sync starts (A manual sync cannot be triggered because the share dialog is open)

The set-up is the same as in the original post.

Method

  • Try to share a notebook with a user without share access or for a non-existent user.
  • Share dialog states either the user has no access or does not exist.
  • A share icon appears next to the notebook title.
  • The bottom of the share dialog has one button (Close).
  • Do not close the dialog and wait.
  • When Joplin auto syncs an "Unshare" button will appear to the left of the close button (possibly because this is the first sync after the failed share?).
  • Click unshare.
  • Joplin syncs after the share is removed.
  • Right click the previous or any other notebook and select share.
  • The dialog opens but the recipient field will not accept text.
  • Close the dialog and try again, unable to type.
  • Close the dialog, start a manual sync and, when complete, try again, still unable to type.
  • Either restart Joplin or
  • Wait and at some point the field will allow input again.

Below is a gif showing the Unshare button appearing with the sync.

unshare

Whilst this was being tested flags.txt was present and the console log and Joplin log are as below.

console.log (185.8 KB)
log.txt (46.7 KB)

  • When Joplin auto syncs an "Unshare" button will appear to the left of the close button (possibly because this is the first sync after the failed share?).

Yes, currently when you share a notebook with someone, two actions happen:

  • The share object is created, which makes the notebook shareable.
  • An invitation is sent to the recipient

In your particular case, although sending the invitation fails, creating the share object succeeds and that's why the Unshare buttons appears as well as the Share icon. I can see how it can be confusing but the behaviour makes sense. It's like when you share a folder in Windows - it just makes the folder shareable but it doesn't mean someone has any permission to access it.

Perhaps that should be better communicated to the user to make it less confusing.

The dialog opens but the recipient field will not accept text.

Somehow I still can't replicate this. Normally this field is disabled only when synchronisation is in progress, or when a notebook is in the process of being shared. But in that case it should show the status below the field (either "Synchronising..." or "Sharing notebook..."). Is it not showing this in your case?

I ensured that there was no sync in progress or even just recently finished.

Are you testing with Windows?

I have just found that when the field is locked, if I click on the desktop to stop Joplin being the active window and then return to Joplin, access is allowed again.

I then tried on a Windows 11 VM and the problem occurred. Access to the recipient field could be regained by making Joplin an inactive window and then returning.

I therefore tried exactly the same with a Linux client on a Mint VM and there was no problem.

It's like Windows is not releasing the lock and I can replicate it on Win10 21H2 and Win11 21H2 (albeit both are Virtualbox VMs). I think that both these Windows VMs share a common ancestor so it could still be a problem at my end. If you cannot replicate on Windows I think it best to leave it there.

I guess that's indeed a Windows issue then as I'm testing on macOS. I'll see if I can replicate it next time i can test on Windows.

By the way how did you get Windows 11 to work with VirtualBox? I've tried several times but when I start the installation I always end up on the very useful "This PC can't run Windows 11" message (without of course any information on what's missing to get it working). I've checked several tutorials and setup the VM options accordingly but nothing seems to help.

Edit: actually I've just found this tutorial and got it working (or at least it's installing) following this method. The missing part with the registry trick.

For the record, Oracle have released official instructions on their blog:

https://blogs.oracle.com/scoter/post/how-to-install-microsoft-windows-11-on-virtualbox

I used the Oracle blog post @tomasz86 mentions.

This also means that my Win11 VM was a fresh install and so there is not a common ancestor for my Windows 10 & 11 VMs.