Skip to content

Commit afdf586

Browse files
committed
Fix: Handle run IDs without prefix in fromFriendlyId()
Bug: Tasks were queuing but not executing due to "Invalid friendly ID format" error. The fromFriendlyId() function expected exactly 2 parts when splitting on underscore, but run IDs from URLs had no prefix. Solution: Check if parts.length === 1 and return the ID as-is if there's no underscore, treating it as an already-parsed internal ID. Impact: Tasks now process normally, no more execution errors. Tested: Deployed in custom Docker images v4.0.4-patched-fixed and verified task execution working correctly in production.
1 parent b2cdc64 commit afdf586

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/core/src/v3/isomorphic/friendlyId.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,11 @@ export function fromFriendlyId(friendlyId: string, expectedEntityName?: string):
3636

3737
const parts = friendlyId.split("_");
3838

39+
// If there's no underscore, assume it's already an internal ID
40+
if (parts.length === 1) {
41+
return friendlyId;
42+
}
43+
3944
if (parts.length !== 2) {
4045
throw new Error("Invalid friendly ID format");
4146
}

packages/trigger-sdk/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,4 +128,4 @@
128128
"main": "./dist/commonjs/v3/index.js",
129129
"types": "./dist/commonjs/v3/index.d.ts",
130130
"module": "./dist/esm/v3/index.js"
131-
}
131+
}

0 commit comments

Comments
 (0)