Skip to content

Commit 3afa42c

Browse files
authored
Make TRIGGER_REALTIME_STREAM_VERSION overridable by the project env vars (#1543)
1 parent 86b1628 commit 3afa42c

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

apps/webapp/app/v3/environmentVariables/environmentVariablesRepository.server.ts

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -662,12 +662,25 @@ export async function resolveVariablesForEnvironment(runtimeEnvironment: Runtime
662662
runtimeEnvironment.id
663663
);
664664

665+
const overridableTriggerVariables = await resolveOverridableTriggerVariables(runtimeEnvironment);
666+
665667
const builtInVariables =
666668
runtimeEnvironment.type === "DEVELOPMENT"
667669
? await resolveBuiltInDevVariables(runtimeEnvironment)
668670
: await resolveBuiltInProdVariables(runtimeEnvironment);
669671

670-
return [...projectSecrets, ...builtInVariables];
672+
return [...overridableTriggerVariables, ...projectSecrets, ...builtInVariables];
673+
}
674+
675+
async function resolveOverridableTriggerVariables(runtimeEnvironment: RuntimeEnvironment) {
676+
let result: Array<EnvironmentVariable> = [
677+
{
678+
key: "TRIGGER_REALTIME_STREAM_VERSION",
679+
value: env.REALTIME_STREAM_VERSION,
680+
},
681+
];
682+
683+
return result;
671684
}
672685

673686
async function resolveBuiltInDevVariables(runtimeEnvironment: RuntimeEnvironment) {
@@ -684,10 +697,6 @@ async function resolveBuiltInDevVariables(runtimeEnvironment: RuntimeEnvironment
684697
key: "TRIGGER_STREAM_URL",
685698
value: env.STREAM_ORIGIN ?? env.API_ORIGIN ?? env.APP_ORIGIN,
686699
},
687-
{
688-
key: "TRIGGER_REALTIME_STREAM_VERSION",
689-
value: env.REALTIME_STREAM_VERSION,
690-
},
691700
];
692701

693702
if (env.DEV_OTEL_BATCH_PROCESSING_ENABLED === "1") {
@@ -758,10 +767,6 @@ async function resolveBuiltInProdVariables(runtimeEnvironment: RuntimeEnvironmen
758767
key: "TRIGGER_ORG_ID",
759768
value: runtimeEnvironment.organizationId,
760769
},
761-
{
762-
key: "TRIGGER_REALTIME_STREAM_VERSION",
763-
value: env.REALTIME_STREAM_VERSION,
764-
},
765770
];
766771

767772
if (env.PROD_OTEL_BATCH_PROCESSING_ENABLED === "1") {

packages/core/src/v3/runMetadata/metadataStream.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export class MetadataStream<T> {
4545
private initializeServerStream(): Promise<void | Response> {
4646
const serverIterator = this.serverIterator;
4747

48-
// TODO: Why is this only sending stuff to the server at the end of the run?
4948
const serverStream = new ReadableStream({
5049
async pull(controller) {
5150
try {

0 commit comments

Comments
 (0)