Skip to content

Bump server/shared: actually wire UtcTimestampSubscriber - #177

Merged
buzz-code merged 1 commit into
mainfrom
claude/timestamp-utc-offset-prod-8tc72k
Sep 4, 2026
Merged

buzz-code merged 1 commit into
mainfrom
claude/timestamp-utc-offset-prod-8tc72k

Conversation

@buzz-code

Copy link
Copy Markdown
Owner

Picks up buzz-code/nra-server#49. The previous bump (#175) shipped UtcTimestampSubscriber registered only as a NestJS provider, which does nothing on its own — TypeORM only picks up a subscriber if it's listed in DataSourceOptions.subscribers. Confirmed live: that fix deployed cleanly but a fresh API write still stored createdAt with local wall-clock digits mislabeled UTC, unchanged.

This bump declares the subscriber in database.config.ts's subscribers array (what TypeOrmModule.forRoot actually reads), and adds an integration test that exercises the real exported databaseConfig through a real DataSource + repository.save() — the gap that let the previous version pass all tests while being broken in production.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Grpcg4VKLrJw9MkLWUMMBS


Generated by Claude Code

Picks up buzz-code/nra-server#49. The previous bump (#175) shipped
UtcTimestampSubscriber registered only as a NestJS provider, which
does nothing on its own - TypeORM only picks up a subscriber if it's
listed in DataSourceOptions.subscribers. Confirmed live: the previous
fix deployed cleanly but a fresh API write still stored createdAt with
local wall-clock digits mislabeled UTC, unchanged.

This bump declares the subscriber in database.config.ts's subscribers
array (what TypeOrmModule.forRoot actually reads), and adds an
integration test that exercises the real exported databaseConfig
through a real DataSource + repository.save() - the gap that let the
previous version pass all tests while being broken in production.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Grpcg4VKLrJw9MkLWUMMBS
Copilot AI lite review requested due to automatic review settings September 4, 2026 09:19
@buzz-code
buzz-code merged commit d5aaff0 into main Sep 4, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

New wiring spec mutates NODE_ENV and loads databaseConfig at module scope in way that can become test-order dependent and miss updatedAt bounds assertion.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Wire UtcTimestampSubscriber into real TypeORM DataSourceOptions.subscribers, so @CreateDateColumn/@UpdateDateColumn values get stamped by app code (not MySQL CURRENT_TIMESTAMP()).

Changes:

  • Add UtcTimestampSubscriber to databaseConfig subscribers for test + production configs
  • Add wiring/integration spec that builds real DataSource from exported databaseConfig and verifies subscriber active on repository.save()
File summaries
File Description
server/shared/config/database.config.ts Register UtcTimestampSubscriber in DataSourceOptions.subscribers
server/shared/utils/entity/tests/utc-timestamp.subscriber.wiring.spec.ts Add regression test validating subscriber wiring via exported databaseConfig
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants