{"record":{"id":"14546714e8cdb842","repo":"spacedriveapp/spacedrive","slug":"window-management-not-available-on-this-platform","errorCode":null,"errorMessage":"Window management not available on this platform","messagePattern":"Window management not available on this platform","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/interface/src/windows/DemoWindow.tsx","lineNumber":45,"sourceCode":"\tconst { data: librariesRaw, isLoading, error, refetch } = useLibraries(true);\n\tconst libraries = librariesRaw as LibraryInfo[] | undefined;\n\tconst [lastEvent, setLastEvent] = useState<any>(null);\n\tconst [eventCount, setEventCount] = useState(0);\n\tconst [windowError, setWindowError] = useState<string | null>(null);\n\n\tconst platform = usePlatform();\n\n\t// Listen to all core events\n\tuseAllEvents((event) => {\n\t\tsetLastEvent(event);\n\t\tsetEventCount((c) => c + 1);\n\t});\n\n\tasync function openWindow(windowType: string, params?: any) {\n\t\ttry {\n\t\t\tsetWindowError(null);\n\t\t\tif (!platform.showWindow) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Window management not available on this platform\",\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tconst windowDef =\n\t\t\t\twindowType === \"Settings\"\n\t\t\t\t\t? { type: \"Settings\", page: params }\n\t\t\t\t\t: { type: windowType, ...params };\n\n\t\t\tawait platform.showWindow(windowDef);\n\t\t\tsetLastEvent({ success: \"Window opened\", type: windowType });\n\t\t} catch (err) {\n\t\t\tconst errMsg = err instanceof Error ? err.message : String(err);\n\t\t\tsetWindowError(errMsg);\n\t\t\tsetLastEvent({ error: \"Window open failed\", message: errMsg });\n\t\t}\n\t}\n","sourceCodeStart":27,"sourceCodeEnd":63,"githubUrl":"https://github.com/spacedriveapp/spacedrive/blob/6dfeccf2113039e35f2ce735f945e70dc3e4ea45/packages/interface/src/windows/DemoWindow.tsx#L27-L63","documentation":"Returned by sync_now when sync_conduit::SyncMode::from_str(&conduit.sync_mode) returns None. The conduit's sync_mode column stores a string ('mirror', 'bidirectional', 'selective' per the SyncMode enum used in resolver.rs), and any other value fails to parse. Note this happens after calculate_operations has already run, which parses the same string itself.","triggerScenarios":"A sync_conduit row whose sync_mode string is not one of the recognized variants — written by an older/newer version with different variant names, a manual UPDATE typo, or a from_str implementation with strict matching receiving e.g. 'Mirror' with wrong casing.","commonSituations":"Schema/enum drift across versions (variant renamed); hand-edited rows; a client submitting a free-text mode that was stored verbatim.","solutions":["Inspect the value: SELECT id, sync_mode FROM sync_conduit WHERE id = <id>.","Correct it to a value SyncMode::from_str accepts (check the enum's from_str in the sync_conduit entity module for exact accepted strings).","Constrain mode input at the API boundary (enum-typed input, not String) so invalid values can never be persisted."],"exampleFix":"-- before\nSELECT sync_mode FROM sync_conduit WHERE id = 7; -- 'Mirrer' (typo)\n\n-- after\nUPDATE sync_conduit SET sync_mode = 'mirror' WHERE id = 7;","handlingStrategy":"validation","validationCode":"// Validate the stored mode before syncing.\nfn sync_mode_is_valid(s: &str) -> bool {\n    sync_conduit::SyncMode::from_str(s).is_some()\n}","typeGuard":null,"tryCatchPattern":"match svc.sync_now(id).await {\n    Ok(h) => Ok(h),\n    Err(e) if e.to_string() == \"Invalid sync mode\" => {\n        // data problem: surface for manual fix, do not silently default\n        Err(anyhow::anyhow!(\"conduit {} has invalid sync_mode in DB; fix the row\", id))\n    }\n    Err(e) => Err(e),\n}","preventionTips":["Pass SyncMode as a typed enum through the API; never accept free-text mode strings.","Add a CHECK constraint on sync_conduit.sync_mode for the known variants.","Run a data audit after version upgrades that rename enum variants."],"tags":["rust","file-sync","enum-parsing","data-integrity"],"backgroundTag":null,"analyzedSha":"6dfeccf2113039e35f2ce735f945e70dc3e4ea45","analyzedAt":"2026-08-16T11:26:17.074Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}