@@ -1004,6 +1004,7 @@ export class EventRepository {
1004
1004
const span = await this . #createSpanFromEvent(
1005
1005
storeTable ,
1006
1006
preparedEvent ,
1007
+ environmentId ,
1007
1008
startCreatedAt ,
1008
1009
endCreatedAt
1009
1010
) ;
@@ -1089,6 +1090,7 @@ export class EventRepository {
1089
1090
async #createSpanFromEvent(
1090
1091
storeTable : TaskEventStoreTable ,
1091
1092
event : PreparedEvent ,
1093
+ environmentId : string ,
1092
1094
startCreatedAt : Date ,
1093
1095
endCreatedAt ?: Date
1094
1096
) {
@@ -1099,6 +1101,7 @@ export class EventRepository {
1099
1101
await this . #walkSpanAncestors(
1100
1102
storeTable ,
1101
1103
event ,
1104
+ environmentId ,
1102
1105
startCreatedAt ,
1103
1106
endCreatedAt ,
1104
1107
( ancestorEvent , level ) => {
@@ -1193,6 +1196,7 @@ export class EventRepository {
1193
1196
async #walkSpanAncestors(
1194
1197
storeTable : TaskEventStoreTable ,
1195
1198
event : PreparedEvent ,
1199
+ environmentId : string ,
1196
1200
startCreatedAt : Date ,
1197
1201
endCreatedAt : Date | undefined ,
1198
1202
callback : ( event : PreparedEvent , level : number ) => { stop : boolean }
@@ -1206,6 +1210,7 @@ export class EventRepository {
1206
1210
let parentEvent = await this . #getSpanEvent( {
1207
1211
storeTable,
1208
1212
spanId : parentId ,
1213
+ environmentId,
1209
1214
startCreatedAt,
1210
1215
endCreatedAt,
1211
1216
} ) ;
@@ -1227,6 +1232,7 @@ export class EventRepository {
1227
1232
parentEvent = await this . #getSpanEvent( {
1228
1233
storeTable,
1229
1234
spanId : preparedParentEvent . parentId ,
1235
+ environmentId,
1230
1236
startCreatedAt,
1231
1237
endCreatedAt,
1232
1238
} ) ;
@@ -1246,15 +1252,15 @@ export class EventRepository {
1246
1252
} : {
1247
1253
storeTable : TaskEventStoreTable ;
1248
1254
spanId : string ;
1249
- environmentId ? : string ;
1255
+ environmentId : string ;
1250
1256
startCreatedAt : Date ;
1251
1257
endCreatedAt ?: Date ;
1252
1258
options ?: { includeDebugLogs ?: boolean } ;
1253
1259
} ) {
1254
1260
return await startActiveSpan ( "getSpanEvent" , async ( s ) => {
1255
1261
const events = await this . taskEventStore . findMany (
1256
1262
storeTable ,
1257
- { spanId, ... ( environmentId ? { environmentId } : { } ) } ,
1263
+ { spanId, environmentId } ,
1258
1264
startCreatedAt ,
1259
1265
endCreatedAt ,
1260
1266
undefined ,
0 commit comments