{"record":{"id":"9a3db8bcead1e16e","repo":"diegosouzapw/OmniRoute","slug":"sync-failed","errorCode":null,"errorMessage":"Sync failed","messagePattern":"Sync failed","errorType":"error_code","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/shared/services/cloudSyncScheduler.ts","lineNumber":112,"sourceCode":"  async sync() {\n    // Check if cloud is enabled\n    const enabled = await isCloudEnabled();\n    if (!enabled) {\n      return null;\n    }\n\n    await this.initializeMachineId();\n\n    // Call internal API route which handles both sync and token update\n    const response = await fetch(`${INTERNAL_BASE_URL}/api/sync/cloud`, {\n      method: \"POST\",\n      headers: { \"Content-Type\": \"application/json\" },\n      body: JSON.stringify({ machineId: this.machineId, action: \"sync\" }),\n    });\n\n    if (!response.ok) {\n      const errorData = await response.json().catch(() => ({}));\n      throw new Error(errorData.error || \"Sync failed\");\n    }\n\n    const result = await response.json();\n    return result;\n  }\n\n  /**\n   * Check if scheduler is running\n   */\n  isRunning() {\n    return this.intervalId !== null;\n  }\n}\n\n// Export a singleton instance if needed\nlet cloudSyncScheduler: CloudSyncScheduler | null = null;\n\nexport async function getCloudSyncScheduler(machineId: string | null = null, intervalMinutes = 15) {","sourceCodeStart":94,"sourceCodeEnd":130,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/shared/services/cloudSyncScheduler.ts#L94-L130","documentation":"Error \"Sync failed\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/shared/services/cloudSyncScheduler.ts:112 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}