Repository navigation
Bump server/shared: pin MySQL connection to UTC - #166
Merged
Merged
Conversation
Picks up buzz-code/nra-server#44, which fixes a timestamp double-conversion bug: mysql2 defaulted to timezone:'local', so attReport.createdAt (used for teacher_reported_today's reportHour) could be stored using the server process's local wall-clock digits and then read back as if they were UTC — a silent hour shift whenever the server's local timezone isn't UTC.
There was a problem hiding this comment.
🟢 Approval recommended
Change is isolated submodule pointer bump to single upstream config fix with low blast radius.
Pull request overview
Bump server/shared git submodule to pull in buzz-code/nra-server change that pins MySQL connection timezone: 'Z' (UTC), preventing Date round-trip hour shifts when server process timezone not UTC.
Changes:
- Update
server/sharedsubmodule pointer from251c30ce…to6bcdbcb4… - Pick up upstream
nra-serverchange addingtimezone: 'Z'to TypeORM MySQLDataSourceOptions
File summaries
| File | Description |
|---|---|
server/shared |
Submodule bump to nra-server commit 6bcdbcb4… adding MySQL UTC timezone pin |
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.
This was referenced Sep 2, 2026
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.
Summary
Reported hours on the "teachers who reported attendance" screen could show a wrong time — e.g. a report made at 10:24 Israel time showing as 13:24.
Root cause
Confirmed in
nra-server's TypeORM MySQLDataSourceOptions: no explicittimezonewas set, so mysql2 defaulted totimezone: 'local'. Fortimestamp/datetime-typed columns (likeAttReport.createdAt, whichreportHouris derived from), TypeORM hands mysql2 a raw JSDateobject; under'local', mysql2 serializes/parses it using the Node process's local getters (getHours()) instead of UTC getters (getUTCHours()). If the server process's local timezone isn't UTC, aDaterepresenting the correct absolute instant gets written using local wall-clock digits, which MySQL then stores as if already UTC — a silent hour shift.Change
Bumps
server/sharedto pick up buzz-code/nra-server#44, which pinstimezone: 'Z'on the mysql connection so writes/reads always go through UTC, independent of the server process's local timezone.Scope
Fixes new writes going forward — does not backfill already-stored (already-shifted) historical
created_at/updated_atvalues.Testing
cd server && yarn build— clean🤖 Generated with Claude Code
Generated by Claude Code