{"record":{"id":"e30258cd256f5e80","repo":"toeverything/AFFiNE","slug":"unsupported-server-version","errorCode":"UNSUPPORTED_SERVER_VERSION","errorMessage":"Unsupported server with version [${receivedVersion}], required version is [>=${MIN_SUPPORTED_SERVER_VERSION}].","messagePattern":"Unsupported server with version \\[(.+?)\\], required version is \\[>=(.+?)\\]\\.","errorType":"error_code","errorClass":"UserFriendlyError","httpStatus":426,"severity":"error","filePath":"packages/frontend/core/src/modules/cloud/stores/server-config.ts","lineNumber":38,"sourceCode":"  /failed to fetch/i,\n  /network request failed/i,\n  /fetch failed/i,\n  /load failed/i,\n  /networkerror/i,\n  /cors/i,\n  /certificate/i,\n  /ssl/i,\n  /err_[a-z_]+/i,\n];\n\nconst MISSING_SERVER_VERSION_PATTERNS = [\n  /cannot query field [\"']?version[\"']? on type [\"']?serverconfigtype[\"']?/i,\n  /field [\"']?version[\"']? is not defined by type [\"']?serverconfigtype[\"']?/i,\n];\n\nexport function createUnsupportedServerVersionError(version?: string | null) {\n  const receivedVersion = version || 'unknown';\n  return new UserFriendlyError({\n    status: 426,\n    code: 'UNSUPPORTED_SERVER_VERSION',\n    type: 'UNSUPPORTED_SERVER_VERSION',\n    name: 'UNSUPPORTED_SERVER_VERSION',\n    message: `Unsupported server with version [${receivedVersion}], required version is [>=${MIN_SUPPORTED_SERVER_VERSION}].`,\n    data: {\n      serverVersion: receivedVersion,\n      requiredVersion: `>=${MIN_SUPPORTED_SERVER_VERSION}`,\n    },\n  });\n}\n\nexport function isSupportedServerVersion(version?: string | null) {\n  const normalized = version && semver.valid(version, { loose: true });\n  return (\n    !!normalized &&\n    semver.gte(normalized, `${MIN_SUPPORTED_SERVER_VERSION}-0`, {\n      loose: true,","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/toeverything/AFFiNE/blob/591f874dad30887a80143a061a44bd3ca7ee3299/packages/frontend/core/src/modules/cloud/stores/server-config.ts#L20-L56","documentation":"Factory producing a UserFriendlyError (HTTP 426, UNSUPPORTED_SERVER_VERSION) when the connected self-hosted server reports a version older than MIN_SUPPORTED_SERVER_VERSION. The client refuses to run against it because API/schema compatibility cannot be assumed; 'unknown' is used when the server exposed no version.","triggerScenarios":"Thrown by assertSupportedServerVersion when the connected server's version is missing or semver-below MIN_SUPPORTED_SERVER_VERSION.","commonSituations":"The client connected to an outdated self-hosted server. Upgrade the AFFiNE server to the required minimum version to continue.","solutions":["Upgrade the server to the minimum supported version.","Use a client version compatible with the server."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"591f874dad30887a80143a061a44bd3ca7ee3299","analyzedAt":"2026-08-18T21:16:52.546Z","contentChangedAt":"2026-08-18T21:16:52.546Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}