{"record":{"id":"74cef1106fb725ea","repo":"laurent22/joplin","slug":"could-not-verify-the-share-status-of-this-notebook","errorCode":null,"errorMessage":"Could not verify the share status of this notebook - aborting. Please try again when you are connected to the internet.","messagePattern":"Could not verify the share status of this notebook - aborting\\. Please try again when you are connected to the internet\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/lib/commands/leaveSharedFolder.ts","lineNumber":33,"sourceCode":"\tforce?: boolean;\n}\n\nexport const runtime = (): CommandRuntime => {\n\treturn {\n\t\texecute: async (_context: CommandContext, folderId: string = null, { force = false }: Options = {}) => {\n\t\t\tconst answer = force ? true : await shim.showConfirmationDialog(\n\t\t\t\t_('This will remove the notebook from your collection and you will no longer have access to its content. Do you wish to continue?'),\n\t\t\t);\n\t\t\tif (!answer) return;\n\n\t\t\ttry {\n\t\t\t\t// Since we are going to delete the notebook, do some extra safety checks. In particular:\n\t\t\t\t// - Check that the notebook is indeed being shared.\n\t\t\t\t// - Check that it does **not** belong to the current user.\n\n\t\t\t\tconst shares = await ShareService.instance().refreshShares();\n\t\t\t\tconst share = shares.find(s => s.folder_id === folderId);\n\t\t\t\tif (!share) throw new Error(_('Could not verify the share status of this notebook - aborting. Please try again when you are connected to the internet.'));\n\n\t\t\t\tawait ShareService.instance().leaveSharedFolder(folderId, share.user.id);\n\t\t\t} catch (error) {\n\t\t\t\tlogger.error(error);\n\t\t\t\tawait shim.showErrorDialog(_('Error: %s', error.message));\n\t\t\t}\n\t\t},\n\t\tenabledCondition: 'joplinServerConnected && folderIsShareRootAndNotOwnedByUser',\n\t};\n};\n","sourceCodeStart":15,"sourceCodeEnd":44,"githubUrl":"https://github.com/laurent22/joplin/blob/2654b33620775080d1d59c552259d41e33dad3d2/packages/lib/commands/leaveSharedFolder.ts#L15-L44","documentation":"Thrown by the leaveSharedFolder command when, after refreshing shares from the server, no share object matches the given folderId. The refresh (ShareService.refreshShares()) either failed silently, returned an incomplete list due to no connectivity, or the folder isn't actually a share root. The command treats this as unsafe and aborts rather than deleting a notebook it can't verify is shared.","triggerScenarios":"Invoking leaveSharedFolder for a folderId while offline or while the Joplin Server share list doesn't include that folder. refreshShares() returns without the matching share, so `shares.find(s => s.folder_id === folderId)` is undefined.","commonSituations":"No internet connection when leaving a shared notebook; the Joplin Server revoked the share between the UI rendering and the command executing; transient server error returning a partial share list; folder is local-only but the command was somehow enabled.","solutions":["Restore connectivity and retry — the command depends on a fresh share list from the server.","Confirm you are connected to the Joplin Server (check sync status) before leaving the share.","If the server is reachable but the share is missing, verify the share still exists via the Joplin Server admin/UI.","Retry the action; transient server-side issues often resolve on the next attempt."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify connectivity and share presence before invoking the command\nconst shares = await ShareService.instance().refreshShares();\nconst share = shares.find(s => s.folder_id === folderId);\nif (!share) {\n  // not shared or offline — do not invoke leaveSharedFolder\n  showNotSharedOrOffline();\n  return;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await leaveSharedFolder(folderId);\n} catch (error) {\n  if (/Could not verify the share status/.test(error.message)) {\n    // prompt the user to reconnect and retry\n    showConnectivityRetry();\n    return;\n  }\n  throw error;\n}","preventionTips":["Confirm a working connection to Joplin Server before leaving a shared folder.","Refresh the share list in the UI so the command is only enabled when the share is verifiable.","Retry transient failures; treat persistent absence of the share as 'already left'."],"tags":["commands","sharing","network","permissions","joplin-server"],"backgroundTag":null,"analyzedSha":"2654b33620775080d1d59c552259d41e33dad3d2","analyzedAt":"2026-08-12T14:26:46.263Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}