fix: regression: sort day by fileCreatedAt again (#18732)

* fix: regression: sort day by fileCreatedAt again

* lint

* e2e test

* inline function

* e2e

* Address comments. Drop dayGroup and timezone in favor of localOffsetMinutes

* lint and some api-doc

* lint, more api-doc

* format

* Move minutes to fractional hours

* make sql

* merge/conflict

* merge fallout, review comments

* spelling

* drop offset from returned date

* move description into decorator where possible, regen api
This commit is contained in:
Min Idzelis 2025-06-05 21:56:32 -04:00 committed by GitHub
parent 81423420c8
commit 55f4e93456
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
23 changed files with 687 additions and 247 deletions

View file

@ -242,7 +242,7 @@ with
and "assets"."visibility" in ('archive', 'timeline')
)
select
"timeBucket",
"timeBucket"::date::text as "timeBucket",
count(*) as "count"
from
"assets"
@ -262,9 +262,16 @@ with
assets.type = 'IMAGE' as "isImage",
assets."deletedAt" is not null as "isTrashed",
"assets"."livePhotoVideoId",
"assets"."localDateTime",
extract(
epoch
from
(
assets."localDateTime" - assets."fileCreatedAt" at time zone 'UTC'
)
)::real / 3600 as "localOffsetHours",
"assets"."ownerId",
"assets"."status",
assets."fileCreatedAt" at time zone 'utc' as "fileCreatedAt",
encode("assets"."thumbhash", 'base64') as "thumbhash",
"exif"."city",
"exif"."country",
@ -313,7 +320,7 @@ with
and "asset_stack"."primaryAssetId" != "assets"."id"
)
order by
"assets"."localDateTime" desc
"assets"."fileCreatedAt" desc
),
"agg" as (
select
@ -326,7 +333,8 @@ with
coalesce(array_agg("isImage"), '{}') as "isImage",
coalesce(array_agg("isTrashed"), '{}') as "isTrashed",
coalesce(array_agg("livePhotoVideoId"), '{}') as "livePhotoVideoId",
coalesce(array_agg("localDateTime"), '{}') as "localDateTime",
coalesce(array_agg("fileCreatedAt"), '{}') as "fileCreatedAt",
coalesce(array_agg("localOffsetHours"), '{}') as "localOffsetHours",
coalesce(array_agg("ownerId"), '{}') as "ownerId",
coalesce(array_agg("projectionType"), '{}') as "projectionType",
coalesce(array_agg("ratio"), '{}') as "ratio",