{"record":{"id":"897d96b7ea8f34a4","repo":"Foundry376/Mailspring","slug":"a-folder-is-required","errorCode":null,"errorMessage":"A folder is required.","messagePattern":"A folder is required\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"app/src/mail-rules-processor.ts","lineNumber":93,"sourceCode":"    return new ChangeStarredTask({\n      starred: true,\n      threads: [thread],\n      source: 'Mail Rules',\n    });\n  },\n\n  forward: (message, thread, value) => {\n    Actions.composeAndSendForward({\n      thread: thread,\n      message: message,\n      to: [new Contact({ email: value })],\n    });\n    return undefined;\n  },\n\n  changeFolder: async (message, thread, value) => {\n    if (!value) {\n      throw new Error('A folder is required.');\n    }\n    const folder = CategoryStore.byId(thread.accountId, value);\n    if (!folder || !(folder instanceof Folder)) {\n      throw new Error('The folder could not be found.');\n    }\n    return new ChangeFolderTask({\n      folder: folder,\n      threads: [thread],\n      source: 'Mail Rules',\n    });\n  },\n\n  applyLabel: async (message, thread, value) => {\n    if (!value) {\n      throw new Error('A label is required.');\n    }\n    const label = CategoryStore.byId(thread.accountId, value);\n    if (!label || !(label instanceof Label)) {","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/Foundry376/Mailspring/blob/648c685d602ece6bb00c22534b8734de6ac644b3/app/src/mail-rules-processor.ts#L75-L111","documentation":"Mail-rule action guard (changeFolder): the rule's condition value — the destination folder id — is empty, so there is nothing to look up in CategoryStore. Means the rule was saved without choosing a target folder for its change-folder action.","triggerScenarios":"Thrown at app/src/mail-rules-processor.ts:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Edit the mail rule and select a destination folder for the change-folder action","Require a folder selection in the rule editor before the rule can be saved"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"648c685d602ece6bb00c22534b8734de6ac644b3","analyzedAt":"2026-09-03T02:00:24.311Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T07:17:11.731Z"}