{"record":{"id":"4fefbfe83dd50bc9","repo":"laurent22/joplin","slug":"no-recipient-found-with-email-email","errorCode":null,"errorMessage":"No recipient found with email ${email}","messagePattern":"No recipient found with email (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/app-cli/app/command-share.ts","lineNumber":108,"sourceCode":"\n\t\tconst commandShareRemove = async (folder: FolderEntity, email: string) => {\n\t\t\tawait ShareService.instance().refreshShares();\n\n\t\t\tconst share = getShareFromFolderId(folder.id);\n\t\t\tif (!share) {\n\t\t\t\tthrow new Error(`No share found for folder ${folder.id}`);\n\t\t\t}\n\n\t\t\tawait ShareService.instance().refreshShareUsers(share.id);\n\n\t\t\tconst shareUsers = getShareUsers(folder.id);\n\t\t\tif (!shareUsers) {\n\t\t\t\tthrow new Error(`No share found for folder ${folder.id}`);\n\t\t\t}\n\n\t\t\tconst targetUser = shareUsers.find(user => user.user?.email === email);\n\t\t\tif (!targetUser) {\n\t\t\t\tthrow new Error(`No recipient found with email ${email}`);\n\t\t\t}\n\n\t\t\tawait ShareService.instance().deleteShareRecipient(targetUser.id);\n\t\t\tthis.stdout(_('Removed %s from share.', targetUser.user.email));\n\t\t};\n\n\t\tconst commandShareList = async () => {\n\t\t\tlet folder = null;\n\t\t\tif (args.notebook) {\n\t\t\t\tfolder = await app().loadItemOrFail(ModelType.Folder, args.notebook);\n\t\t\t}\n\n\t\t\tawait ShareService.instance().maintenance();\n\n\t\t\tif (folder) {\n\t\t\t\tconst share = getShareFromFolderId(folder.id);\n\t\t\t\tawait ShareService.instance().refreshShareUsers(share.id);\n","sourceCodeStart":90,"sourceCodeEnd":126,"githubUrl":"https://github.com/laurent22/joplin/blob/2654b33620775080d1d59c552259d41e33dad3d2/packages/app-cli/app/command-share.ts#L90-L126","documentation":"Thrown in `commandShareRemove` when the recipient list was loaded but no entry has a `user.email` matching the supplied email argument. The share exists and has recipients, just none with that exact email address. The email is interpolated so the user can see which address failed.","triggerScenarios":"Running `share remove <notebook> <email>` where `<email>` does not case-exactly match any `shareUsers[*].user.email`. Common causes: trailing whitespace, different capitalization, or the recipient was invited under a secondary email.","commonSituations":"Typo in the email argument; copy-paste introduced whitespace; recipient's account email changed; the recipient was already removed so the list no longer contains them.","solutions":["Run `share list <notebook>` and copy the exact email shown in the recipient list.","Trim whitespace and verify lowercase/uppercase matches the stored value.","If the recipient is absent from the list, they were already removed — nothing to do."],"exampleFix":"// before\nconst targetUser = shareUsers.find(user => user.user?.email === email);\nif (!targetUser) throw new Error(`No recipient found with email ${email}`);\n\n// after - case-insensitive match and a clearer message listing valid emails\nconst targetUser = shareUsers.find(u => u.user?.email?.toLowerCase() === email.trim().toLowerCase());\nif (!targetUser) throw new Error(`No recipient \"${email}\" on this share. Recipients: ${shareUsers.map(u => u.user?.email).join(', ')}`);","handlingStrategy":"validation","validationCode":"const targetUser = shareUsers.find(u => u.user?.email?.toLowerCase() === email.trim().toLowerCase());\nif (!targetUser) {\n\tthrow new Error(`No recipient \"${email}\" on this share. Recipients: ${shareUsers.map(u => u.user?.email).join(', ')}`);\n}","typeGuard":"const isValidEmail = (v: unknown): v is string => typeof v === 'string' && /^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/.test(v);","tryCatchPattern":"try {\n\tawait commandShareRemove(folder, email);\n} catch (e) {\n\tif (/No recipient found/.test(e.message)) { /* re-list recipients and reprompt */ }\n\telse throw e;\n}","preventionTips":["Copy the email verbatim from `share list <notebook>` output.","Normalize case and trim whitespace before comparing emails.","Confirm the recipient still appears in the list before removal."],"tags":["share","recipient","email","remove-recipient","cli","not-found"],"backgroundTag":null,"analyzedSha":"2654b33620775080d1d59c552259d41e33dad3d2","analyzedAt":"2026-08-12T14:26:46.263Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}