spacedriveapp/spacedrive · error
Window management not available on this platform
Error message
Window management not available on this platform
What it means
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.
Source
Thrown at packages/interface/src/windows/DemoWindow.tsx:45
const { data: librariesRaw, isLoading, error, refetch } = useLibraries(true);
const libraries = librariesRaw as LibraryInfo[] | undefined;
const [lastEvent, setLastEvent] = useState<any>(null);
const [eventCount, setEventCount] = useState(0);
const [windowError, setWindowError] = useState<string | null>(null);
const platform = usePlatform();
// Listen to all core events
useAllEvents((event) => {
setLastEvent(event);
setEventCount((c) => c + 1);
});
async function openWindow(windowType: string, params?: any) {
try {
setWindowError(null);
if (!platform.showWindow) {
throw new Error(
"Window management not available on this platform",
);
}
const windowDef =
windowType === "Settings"
? { type: "Settings", page: params }
: { type: windowType, ...params };
await platform.showWindow(windowDef);
setLastEvent({ success: "Window opened", type: windowType });
} catch (err) {
const errMsg = err instanceof Error ? err.message : String(err);
setWindowError(errMsg);
setLastEvent({ error: "Window open failed", message: errMsg });
}
}
View on GitHub (pinned to 6dfeccf211)
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.
Example fix
-- before SELECT sync_mode FROM sync_conduit WHERE id = 7; -- 'Mirrer' (typo) -- after UPDATE sync_conduit SET sync_mode = 'mirror' WHERE id = 7;
Defensive patterns
Strategy: validation
Validate before calling
// Validate the stored mode before syncing.
fn sync_mode_is_valid(s: &str) -> bool {
sync_conduit::SyncMode::from_str(s).is_some()
} Try / catch
match svc.sync_now(id).await {
Ok(h) => Ok(h),
Err(e) if e.to_string() == "Invalid sync mode" => {
// data problem: surface for manual fix, do not silently default
Err(anyhow::anyhow!("conduit {} has invalid sync_mode in DB; fix the row", id))
}
Err(e) => Err(e),
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: Schema/enum drift across versions (variant renamed); hand-edited rows; a client submitting a free-text mode that was stored verbatim.
Related errors
- Failed to read service account file: {}
- Failed to initialize core: error code ${result}
- Library with ID '${libraryId}' not found
- This operation requires an active library. Use switchToLibra
- ${isQuery ? "Query" : "Action"} failed: ${JSON.stringify(err
AI-assisted analysis of spacedriveapp/spacedrive@6dfeccf211 (2026-08-16).
Data as JSON: /api/errors/14546714e8cdb842.
Report an issue: GitHub.