fix(server): use correct day ordering in timeline buckets (#26821)

* fix(web): sort timeline day groups received from server

* fix(server): use correct day ordering in timeline buckets
This commit is contained in:
Michel Heusschen
2026-03-11 13:49:35 +01:00
committed by GitHub
parent 9fc6fbc373
commit 27f69b39b2
3 changed files with 61 additions and 1 deletions

View File

@@ -438,6 +438,7 @@ with
and "stack"."primaryAssetId" != "asset"."id"
)
order by
(asset."localDateTime" AT TIME ZONE 'UTC')::date desc,
"asset"."fileCreatedAt" desc
),
"agg" as (

View File

@@ -744,6 +744,7 @@ export class AssetRepository {
params: [DummyValue.TIME_BUCKET, { withStacked: true }, { user: { id: DummyValue.UUID } }],
})
getTimeBucket(timeBucket: string, options: TimeBucketOptions, auth: AuthDto) {
const order = options.order ?? 'desc';
const query = this.db
.with('cte', (qb) =>
qb
@@ -841,7 +842,8 @@ export class AssetRepository {
)
.$if(!!options.isTrashed, (qb) => qb.where('asset.status', '!=', AssetStatus.Deleted))
.$if(!!options.tagId, (qb) => withTagId(qb, options.tagId!))
.orderBy('asset.fileCreatedAt', options.order ?? 'desc'),
.orderBy(sql`(asset."localDateTime" AT TIME ZONE 'UTC')::date`, order)
.orderBy('asset.fileCreatedAt', order),
)
.with('agg', (qb) =>
qb