{"record":{"id":"e1e24256503742ec","repo":"louislam/uptime-kuma","slug":"no-wxpusher-spt-is-configured","errorCode":null,"errorMessage":"No WxPusher SPT is configured","messagePattern":"No WxPusher SPT is configured","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/notification-providers/wxpusher.js","lineNumber":25,"sourceCode":"\n    // WxPusher's simple-push accepts at most 10 SPTs per request.\n    static SPT_PER_REQUEST = 10;\n\n    /**\n     * @inheritdoc\n     */\n    async send(notification, msg, monitorJSON = null, heartbeatJSON = null) {\n        const okMsg = \"Sent Successfully.\";\n\n        // Accept one or multiple SPTs, comma-separated.\n        const sptList = String(notification.wxpusherSPT || \"\")\n            .split(\",\")\n            .map((spt) => spt.trim())\n            .filter((spt) => spt.length > 0);\n\n        try {\n            if (sptList.length === 0) {\n                throw new Error(\"No WxPusher SPT is configured\");\n            }\n\n            const summary = this.checkStatus(heartbeatJSON, monitorJSON).slice(0, 100);\n            const config = this.getAxiosConfigWithProxy({});\n\n            // Send in batches so more than 10 SPTs are all delivered, never silently dropped.\n            for (let i = 0; i < sptList.length; i += WxPusher.SPT_PER_REQUEST) {\n                const context = {\n                    content: msg,\n                    summary,\n                    contentType: 1,\n                    sptList: sptList.slice(i, i + WxPusher.SPT_PER_REQUEST),\n                };\n                const result = await axios.post(\n                    \"https://wxpusher.zjiecode.com/api/send/message/simple-push\",\n                    context,\n                    config\n                );","sourceCodeStart":7,"sourceCodeEnd":43,"githubUrl":"https://github.com/louislam/uptime-kuma/blob/6b5ea0155793e666666745fb8d6fef1e829543a2/server/notification-providers/wxpusher.js#L7-L43","documentation":"Thrown by the WxPusher provider when, after splitting notification.wxpusherSPT on commas, trimming, and filtering empty strings, the resulting sptList has length 0. WxPusher's simple-push API requires at least one SPT (Simple Push Token) per request, so an empty list is rejected before any HTTP call.","triggerScenarios":"wxpusherSPT field blank, whitespace-only, or set to a string of commas only. Also occurs if the field was never populated after creating the notification.","commonSituations":"User created the WxPusher notification but did not paste the app SPT, or the SPT was cleared during an edit and saved empty.","solutions":["Open the WxPusher app/website, copy the SPT (Simple Push Token) for the target user, and paste it into the wxpusherSPT field.","For multiple recipients, paste comma-separated SPTs; the provider batches them 10 per request.","Save and click Test to confirm delivery.","If the SPT contains leading/trailing spaces, the trim() handles it — no manual cleanup needed."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate SPT presence before entering the request loop\nconst sptList = String(notification.wxpusherSPT || \"\")\n    .split(\",\").map((s) => s.trim()).filter(Boolean);\nif (sptList.length === 0) {\n    throw new Error(\"No WxPusher SPT is configured\");\n}","typeGuard":"/** True when the SPT list has at least one non-empty token. */\nfunction hasWxPusherSpt(notification) {\n    return String(notification.wxpusherSPT || \"\").split(\",\").some((s) => s.trim().length > 0);\n}","tryCatchPattern":"if (!hasWxPusherSpt(notification)) {\n    throw new Error(\"No WxPusher SPT is configured\");\n}\ntry {\n    for (let i = 0; i < sptList.length; i += WxPusher.SPT_PER_REQUEST) {\n        const result = await axios.post(url, context, config);\n        if (result.data.code !== 1000) throw result.data.msg;\n    }\n} catch (err) { this.throwGeneralAxiosError(err); }","preventionTips":["Always paste at least one SPT when creating the notification.","Use comma separation for multiple SPTs.","Run Test after first setup."],"tags":["wxpusher","notification-provider","config","validation"],"backgroundTag":null,"analyzedSha":"6b5ea0155793e666666745fb8d6fef1e829543a2","analyzedAt":"2026-08-12T23:42:12.959Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}