Repository navigation
Bump server/shared: explicit createdAt/updatedAt stamping fix - #175
Merged
Merged
Conversation
Picks up buzz-code/nra-server#48: UtcTimestampSubscriber stamps createdAt/updatedAt with an explicit Date right before persistence, bypassing MySQL's own CURRENT_TIMESTAMP() default - which evaluates using the MySQL server's SESSION time_zone, independent of mysql2's timezone: 'Z' connection option (nra-server#44). Root cause of the timestamp bug persisting after the earlier fix: confirmed live that this shared MySQL instance's SYSTEM time_zone isn't UTC, and CURRENT_TIMESTAMP() was silently writing local wall-clock digits mislabeled UTC. Applies automatically to every @CreateDateColumn/@UpdateDateColumn in this repo (att_reports, and 20+ other entities) - no per-entity wiring needed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Grpcg4VKLrJw9MkLWUMMBS
There was a problem hiding this comment.
🟢 Approval recommended
Change limited to submodule pointer bump; no additional repo code changes and update aligns with stated timestamp fix scope.
Pull request overview
Update server/shared submodule to pick up shared TypeORM UtcTimestampSubscriber change, so createdAt/updatedAt get explicitly stamped in app layer (avoids MySQL CURRENT_TIMESTAMP() session time_zone behavior) across all entities using @CreateDateColumn/@UpdateDateColumn.
Changes:
- Bump
server/sharedsubmodule pointer to newer commit containingUtcTimestampSubscriberregistration and tests.
File summaries
| File | Description |
|---|---|
| server/shared | Submodule commit bump to include explicit UTC timestamp stamping subscriber |
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.
buzz-code
pushed a commit
that referenced
this pull request
Sep 4, 2026
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
buzz-code
added a commit
that referenced
this pull request
Sep 4, 2026
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. Claude-Session: https://claude.ai/code/session_01Grpcg4VKLrJw9MkLWUMMBS Co-authored-by: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Picks up buzz-code/nra-server#48:
UtcTimestampSubscriberstampscreatedAt/updatedAtwith an explicitDateright before persistence, bypassing MySQL's ownCURRENT_TIMESTAMP()default — which evaluates using the MySQL server's sessiontime_zone, independent of mysql2'stimezone: 'Z'connection option (#44/#166).Root cause of the timestamp bug persisting after the earlier fix: confirmed live (via a real API call cross-checked against
date -u, and a directSELECT NOW(), UTC_TIMESTAMP();on the shared MySQL instance) that itsSYSTEMtime_zone isn't UTC — soCURRENT_TIMESTAMP()was silently writing local wall-clock digits mislabeled UTC intocreatedAt/updatedAt, regardless of the app-side fix.Applies automatically to every
@CreateDateColumn/@UpdateDateColumnin this repo (att_reportsand 20+ other entities) — no per-entity wiring needed.🤖 Generated with Claude Code
https://claude.ai/code/session_01Grpcg4VKLrJw9MkLWUMMBS
Generated by Claude Code