{"record":{"id":"17daf20d47d97186","repo":"Mintplex-Labs/anything-llm","slug":"could-not-update-status","errorCode":null,"errorMessage":"Could not update status.","messagePattern":"Could not update status\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"frontend/src/models/experimental/liveSync.js","lineNumber":13,"sourceCode":"import { API_BASE } from \"@/utils/constants\";\nimport { baseHeaders } from \"@/utils/request\";\n\nconst LiveDocumentSync = {\n  featureFlag: \"experimental_live_file_sync\",\n  toggleFeature: async function (updatedStatus = false) {\n    return await fetch(`${API_BASE}/experimental/toggle-live-sync`, {\n      method: \"POST\",\n      headers: baseHeaders(),\n      body: JSON.stringify({ updatedStatus }),\n    })\n      .then((res) => {\n        if (!res.ok) throw new Error(\"Could not update status.\");\n        return true;\n      })\n      .then((res) => res)\n      .catch((e) => {\n        console.error(e);\n        return false;\n      });\n  },\n  queues: async function () {\n    return await fetch(`${API_BASE}/experimental/live-sync/queues`, {\n      headers: baseHeaders(),\n    })\n      .then((res) => {\n        if (!res.ok) throw new Error(\"Could not update status.\");\n        return res.json();\n      })\n      .then((res) => res?.queues || [])\n      .catch((e) => {","sourceCodeStart":1,"sourceCodeEnd":31,"githubUrl":"https://github.com/Mintplex-Labs/anything-llm/blob/526360e320da9d1b36074be5ed64fe76e5bbfbbd/frontend/src/models/experimental/liveSync.js#L1-L31","documentation":"Thrown by LiveDocumentSync.toggleFeature when the POST to /experimental/toggle-live-sync returns non-OK, with the fixed string 'Could not update status.'. The .catch returns false, so callers see only a boolean failure with no reason. The method also references a featureFlag ('experimental_live_file_sync') hinting this is gated server-side.","triggerScenarios":"updatedStatus payload rejected; experimental_live_file_sync flag disabled for this user/tenant; non-admin caller; backend route moved between releases.","commonSituations":"Non-admin user toggling an experimental feature; tenant-level flag off; frontend built against an older API path than the running backend; race where another admin changed the flag concurrently.","solutions":["Confirm the caller has admin rights and the experimental flag is enabled tenant-wide.","Send updatedStatus as a strict boolean.","Inspect the network response for the real status code.","Reload the feature-flag state after a failure to re-sync UI with backend."],"exampleFix":"// before\nconst ok = await LiveDocumentSync.toggleFeature(next);\nif (!ok) showToast('Failed', 'error');\n\n// after\nconst ok = await LiveDocumentSync.toggleFeature(Boolean(next));\nif (!ok) showToast('Could not toggle live sync - check permissions and feature flag', 'error');","handlingStrategy":"validation","validationCode":"function validateToggleArgs(next) {\n  if (typeof next !== 'boolean') return 'updatedStatus must be boolean';\n  return null;\n}","typeGuard":"/** @param {unknown} r */\nfunction isToggleResult(r) { return typeof r === 'boolean'; }","tryCatchPattern":"const ok = await LiveDocumentSync.toggleFeature(next);\nif (!ok) showToast('Could not toggle live sync - check feature flag and permissions', 'error');","preventionTips":["Confirm admin rights and that experimental_live_file_sync is enabled.","Always pass a strict boolean to avoid coercion surprises.","Re-sync the feature-flag UI state after a failure.","Read the network response for the real status code."],"tags":["api","experimental","live-sync","feature-flag","error-handling"],"backgroundTag":null,"analyzedSha":"526360e320da9d1b36074be5ed64fe76e5bbfbbd","analyzedAt":"2026-08-13T01:45:47.170Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}