@@ -84,14 +84,14 @@ type LogCursor = {
8484 organizationId : string ;
8585 environmentId : string ;
8686 triggeredTimestamp : string ; // DateTime64(9) string
87- spanId : string ;
87+ traceId : string ;
8888} ;
8989
9090const LogCursorSchema = z . object ( {
9191 organizationId : z . string ( ) ,
9292 environmentId : z . string ( ) ,
9393 triggeredTimestamp : z . string ( ) ,
94- spanId : z . string ( ) ,
94+ traceId : z . string ( ) ,
9595} ) ;
9696
9797function encodeCursor ( cursor : LogCursor ) : string {
@@ -321,19 +321,19 @@ export class LogsListPresenter extends BasePresenter {
321321 }
322322
323323 // Cursor pagination using explicit lexicographic comparison
324- // Must mirror the ORDER BY columns: (organization_id DESC , environment_id DESC , triggered_timestamp DESC, span_id DESC )
324+ // Must mirror the ORDER BY columns: (organization_id, environment_id, triggered_timestamp, trace_id )
325325 const decodedCursor = cursor ? decodeCursor ( cursor ) : null ;
326326 if ( decodedCursor ) {
327327 queryBuilder . where (
328- `(triggered_timestamp < {cursorTriggeredTimestamp: String} OR (triggered_timestamp = {cursorTriggeredTimestamp: String} AND span_id < {cursorSpanId : String}))` ,
328+ `(triggered_timestamp < {cursorTriggeredTimestamp: String} OR (triggered_timestamp = {cursorTriggeredTimestamp: String} AND trace_id < {cursorTraceId : String}))` ,
329329 {
330330 cursorTriggeredTimestamp : decodedCursor . triggeredTimestamp ,
331- cursorSpanId : decodedCursor . spanId ,
331+ cursorTraceId : decodedCursor . traceId ,
332332 }
333333 ) ;
334334 }
335335
336- queryBuilder . orderBy ( "triggered_timestamp DESC, span_id DESC" ) ;
336+ queryBuilder . orderBy ( "triggered_timestamp DESC, trace_id DESC" ) ;
337337 // Limit + 1 to check if there are more results
338338 queryBuilder . limit ( pageSize + 1 ) ;
339339
@@ -355,7 +355,7 @@ export class LogsListPresenter extends BasePresenter {
355355 organizationId,
356356 environmentId,
357357 triggeredTimestamp : lastLog . triggered_timestamp ,
358- spanId : lastLog . span_id ,
358+ traceId : lastLog . trace_id ,
359359 } ) ;
360360 }
361361
0 commit comments