{"record":{"id":"2bd49312c031cfac","repo":"toeverything/AFFiNE","slug":"challenge-failed","errorCode":null,"errorMessage":"Challenge failed","messagePattern":"Challenge failed","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/frontend/apps/electron-renderer/src/app/effects/modules.ts","lineNumber":76,"sourceCode":"        });\n      },\n    };\n  });\n  framework.impl(ClientSchemeProvider, p => {\n    const appInfo = p.get(DesktopApiService).appInfo;\n    return {\n      getClientScheme() {\n        return appInfo?.scheme;\n      },\n    };\n  });\n  framework.impl(ValidatorProvider, p => {\n    const apis = p.get(DesktopApiService).api;\n    return {\n      async validate(_challenge, resource) {\n        const token = await apis.handler.ui.getChallengeResponse(resource);\n        if (!token) {\n          throw new Error('Challenge failed');\n        }\n        return token;\n      },\n    };\n  });\n  framework.scope(ServerScope).override(AuthProvider, p => {\n    const apis = p.get(DesktopApiService).api;\n    const serverService = p.get(ServerService);\n    const endpoint = serverService.server.baseUrl;\n\n    return {\n      async signInMagicLink(email, token, clientNonce) {\n        const result = await apis.handler.auth.signInMagicLink(\n          endpoint,\n          email,\n          token,\n          clientNonce\n        );","sourceCodeStart":58,"sourceCodeEnd":94,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/b4c8548c09da21b2898443559a5b846f0ccf5dd8/packages/frontend/apps/electron-renderer/src/app/effects/modules.ts#L58-L94","documentation":"The ValidatorProvider impl resolves a client-scheme challenge by asking the desktop UI for a challenge response token and throws 'Challenge failed' when none is returned, blocking resource validation from proceeding.","triggerScenarios":"Thrown at packages/frontend/apps/electron-renderer/src/app/effects/modules.ts:76 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the challenge flow; transient network or timing issues can cause failure.","Verify the challenge parameters and that the native side is responding.","Restart the app if the challenge state is stuck."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"b4c8548c09da21b2898443559a5b846f0ccf5dd8","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}