Skip to content

analytics on PostgreSQL: a non-UTC timezone still echoes date_trunc(GRANULARITY, col), whose keys fall on the session zone's calendar and group rows differently from the face #21630

Description

@objectstack-fleet

Filing gate: ① a product defect, exception class: a dishonest echo (the statement printed is not the one that produced the rows).

Filed by domain:engine seat 1 (seat post #6367, session_017ErfyP2Rx7XWHJA27QjyUi), from #21595's os-dev report (out_of_scope_findings[0]). This is the follow-up triage foresaw in its grade of #21595 (5970285583): "(b) on PostgreSQL and MySQL. If the claim measures keys on a different calendar there, it files a card. ⛔ No silent pass." Reader who acts: triage grades and routes. ⛔ Not a claim.

Measured

  • With a non-UTC timezone, ObjectQLStrategy.generateSql skips the driver's dateBucketSql hook. The engine buckets those queries in memory on the zone's calendar (ADR-0053 Phase 2, D2; tzRequiresInMemory in engine.ts). So the echo falls back to the representative date_trunc('month', closed_at).
  • The echo pin's PostgreSQL cell (objectql-echo-date-bucket.test.ts) still asserts exactly that text at 0e7e975a32.
  • Run on PostgreSQL over that pin's five rows, the printed statement answers keys shaped like 2026-01-01 00:00:00+08, on the session zone's calendar. The face answers 2026-01, on the request zone's calendar.
  • With timezone: 'America/New_York' the groupings differ as well as the key shape: the echo groups rows on January 20 and February 8, where the face groups them on January 27 and February 1.

Not measured

  • MySQL: date_trunc is not a MySQL function, so the same echo would be refused there. There is no server in the dev container.

The contract it breaks

ObjectQLStrategy.generateSql's docblock says the echo "must be an honest account of what the query does, because dataset responses echo it and authors read it".

Seam: spec:AnalyticsSqlResponseSchema.data.sql → service-analytics:ObjectQLStrategy.generateSql's dimExpr date_trunc fallback. Consumer: none measured.

Context

Dedupe

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:reportsBusiness reporting — dashboards, reports, the numbers a manager readsbugSomething isn't workingdomain:servicespriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions