fix: honor APP_TIMEZONE for date-sensitive operations#157
Merged
Conversation
config/app.php had no timezone key, so the framework always ran in UTC. Daily digests generated by an evening cron were dated tomorrow and the 24-hour recency window skewed by the UTC offset. Defaults to UTC when APP_TIMEZONE is unset — no behavior change for existing installs.
There was a problem hiding this comment.
Ship it.
- Single targeted addition of
'timezone' => env('APP_TIMEZONE', 'UTC')aftername; matches Laravel convention and leaves default unchanged. - No key collisions or ordering issues in the minimal config/app.php.
- PR body and verification (
synthesize --digest --dry-run) confirm the exact behavior change needed for odin nightlies. - Test suite unaffected per author note (Carbon::setTestNow).
📊 Coverage Report
Files Below Threshold
🏆 Synapse Sentinel Gate |
🔧 Synapse Sentinel: 1 check need attentionThe following issues must be resolved before this PR can be merged: Security AuditReview the output and fix any issues.Quick Reference:
🤖 Generated by Synapse Sentinel - View Run |
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.
The bug
config/app.phphad notimezonekey, soCarbon::today()/yesterday()always ran in UTC. On odin the nightly 23:00 MST synthesis cron generated digests dated tomorrow and the digest recency window skewed 7 hours.The fix
One config key:
'timezone' => env('APP_TIMEZONE', 'UTC'). Default unchanged (UTC) — opt-in per deployment.Verification
Live on odin with
APP_TIMEZONE=America/Phoenix:synthesize --digest --dry-runat 21:45 MST now reportsGenerating digest for 2026-07-02(was 2026-07-03). Synthesize test suite: 15/15 passing (tests pin Carbon::setTestNow, unaffected by the default).