{"record":{"id":"58b7758f8d92cbb7","repo":"redis/node-redis","slug":"action-action-type-not-implemented","errorCode":null,"errorMessage":"Action ${action.type} not implemented","messagePattern":"Action (.+?) not implemented","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/test-utils/lib/fault-injector/proxied-fault-injector-cluster.ts","lineNumber":32,"sourceCode":"}\n\nexport class ProxiedFaultInjectorClientForCluster\n  implements IFaultInjectorClient\n{\n  constructor(private readonly proxyController: ProxyController) {}\n    listActionTriggers(actionName: string, effect: string): Promise<ActionTrigger[]> {\n        throw new Error(\"Method not implemented.\");\n    }\n\n  async triggerAction(action: ActionRequest, _options?: TriggerActionOptions): Promise<ActionStatus> {\n    switch (action.type) {\n      case \"migrate\": {\n        return this.triggerMigrate(\n          action.parameters as unknown as MigrateParameters\n        );\n      }\n      default:\n        throw new Error(`Action ${action.type} not implemented`);\n    }\n  }\n\n  async getProxyNodes() {\n    const nodes = await this.proxyController.getNodes();\n    return nodes.ids.map(parseNodeId);\n  }\n\n  async updateClusterSlots(nodes: ProxyNode[]) {\n    return this.proxyController.addInterceptor(\n      \"cluster\",\n      \"*2\\r\\n$7\\r\\ncluster\\r\\n$5\\r\\nslots\\r\\n\",\n      buildClusterSlotsResponse(nodes, \"raw\"),\n      \"raw\"\n    );\n  }\n\n  /**","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/redis/node-redis/blob/90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58/packages/test-utils/lib/fault-injector/proxied-fault-injector-cluster.ts#L14-L50","documentation":"ProxiedFaultInjectorClientForCluster.triggerAction only implements the 'migrate' action type; any other action.type falls through the switch to the default and throws. This proxied client simulates migrations via push notifications rather than calling the HTTP fault-injector, so only migrate is meaningful here.","triggerScenarios":"Calling triggerAction on a ProxiedFaultInjectorClientForCluster with type other than 'migrate' — e.g., 'create_database', 'delete_database', 'sequence_of_actions', 'bind'.","commonSituations":"Test code that swaps a FaultInjectorClient for the proxied variant but still issues non-migrate actions; generic test harness iterating over all action types.","solutions":["Route non-migrate actions through the real FaultInjectorClient (HTTP) instead of the proxied client","If you need the proxied client to handle another type, extend the switch in triggerAction","Guard the call site: only invoke the proxied client for type === 'migrate'"],"exampleFix":"// before — unsupported action on proxied client\nawait proxiedFi.triggerAction({ type: 'create_database', parameters: {...} });\n// Error: Action create_database not implemented\n\n// after — use the HTTP client for non-migrate actions\nawait httpFi.triggerAction({ type: 'create_database', parameters: {...} });\n// reserve proxiedFi for { type: 'migrate', ... } only","handlingStrategy":"type-guard","validationCode":"function isProxiedSupportedAction(action: ActionRequest): boolean {\n  return action.type === 'migrate';\n}","typeGuard":"function isMigrateAction(action: ActionRequest): action is ActionRequest & { type: 'migrate' } {\n  return action.type === 'migrate';\n}","tryCatchPattern":"try {\n  await proxiedFi.triggerAction(action);\n} catch (e) {\n  if (e instanceof Error && /not implemented/.test(e.message)) {\n  }\n  throw e;\n}","preventionTips":["Route only migrate actions to the proxied client; use FaultInjectorClient for everything else","Guard call sites with a type check before dispatching to the proxied client","Extend the proxied switch if you genuinely need another action type simulated through the proxy"],"tags":["fault-injection","proxy","test-utils","not-implemented"],"backgroundTag":null,"analyzedSha":"90fd0652bc3f2a0a1b2f79fa9096b02a86b0ac58","analyzedAt":"2026-08-11T15:37:21.243Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}