{"record":{"id":"243e930e8ac02a00","repo":"ruvnet/ruflo","slug":"wasm-topo-sort-failed-falling-back-to-js","errorCode":null,"errorMessage":"WASM topo sort failed, falling back to JS","messagePattern":"WASM topo sort failed, falling back to JS","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"v3/plugins/gastown-bridge/src/convoy/observer.ts","lineNumber":530,"sourceCode":"\n    if (this.config.useWasm && this.wasmModule) {\n      try {\n        const wasmNodes = this.beadsToWasmNodes(beads);\n        const resultJson = this.wasmModule.topo_sort(JSON.stringify(wasmNodes));\n        const result: TopoSortResult = JSON.parse(resultJson);\n\n        if (result.hasCycle) {\n          throw new GasTownError(\n            'Cannot compute execution order: dependency cycle detected',\n            GasTownErrorCode.DEPENDENCY_CYCLE,\n            { cycleNodes: result.cycleNodes }\n          );\n        }\n\n        return result.sorted;\n      } catch (error) {\n        if (error instanceof GasTownError) throw error;\n        this.logger.warn('WASM topo sort failed, falling back to JS', {\n          error: error instanceof Error ? error.message : String(error),\n        });\n      }\n    }\n\n    // JavaScript fallback using Kahn's algorithm\n    return this.topoSortJS(beads);\n  }\n\n  /**\n   * Stop watching a convoy\n   */\n  stopWatching(convoyId: string): void {\n    const watcher = this.watchers.get(convoyId);\n    if (watcher) {\n      clearTimeout(watcher.timer);\n      this.watchers.delete(convoyId);\n","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/ruvnet/ruflo/blob/fa13ee4ad60ac2090b1480656eb233521790d640/v3/plugins/gastown-bridge/src/convoy/observer.ts#L512-L548","documentation":"Log warning in getExecutionOrder: the WASM topo_sort call failed (other than the deliberate cycle error); the method falls back to the JS topological sort to compute execution order.","triggerScenarios":"Thrown at v3/plugins/gastown-bridge/src/convoy/observer.ts:530 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the WASM topo sort error; the JS fallback is used — reinstall or rebuild the WASM module to restore speed."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fa13ee4ad60ac2090b1480656eb233521790d640","analyzedAt":"2026-08-18T21:34:22.708Z","contentChangedAt":"2026-08-18T21:34:22.708Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}