Skip to content

Commit 8e5d5cf

Browse files
authored
fix: only pass engine version header when inside a task (#1871)
This will allow migrating to the v4 SDK in your application backend before deploying v4 to trigger, and everything will just work
1 parent dcacc3a commit 8e5d5cf

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/v3/apiClient/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,6 @@ export class ApiClient {
973973
"Content-Type": "application/json",
974974
Authorization: `Bearer ${this.accessToken}`,
975975
"trigger-version": VERSION,
976-
"x-trigger-engine-version": "V2",
977976
...Object.entries(additionalHeaders ?? {}).reduce(
978977
(acc, [key, value]) => {
979978
if (value !== undefined) {
@@ -989,6 +988,8 @@ export class ApiClient {
989988
// Only inject the context if we are inside a task
990989
if (taskContext.isInsideTask) {
991990
headers["x-trigger-worker"] = "true";
991+
// Only pass the engine version if we are inside a task
992+
headers["x-trigger-engine-version"] = "V2";
992993

993994
if (spanParentAsLink) {
994995
headers["x-trigger-span-parent-as-link"] = "1";

0 commit comments

Comments
 (0)