feat(runtime): resolve a reference timezone onto ExecutionContext#1993
Merged
Conversation
ADR-0053 Phase 2 foundation. Adds `ExecutionContext.timezone` (optional IANA zone) and resolves it once per request in resolveExecutionContext, precedence user preference -> org default -> UTC: - user override: sys_user_preference (user_id, key='timezone') - org default: tenant-scoped sys_setting (namespace='localization', key='timezone', scope='tenant') — one org per physical tenant (ADR-0002), so no tenant_id filter - invalid IANA zone ignored, falls through; every read defensive via tryFind, never blocks auth Pure plumbing, no behavior change: nothing reads ctx.timezone yet and an absent value resolves to UTC (today's behavior). Foundation consumed by the rest of Phase 2 — tz-aware today()/daysFromNow() (#1980), datetime rendering (#1981), analytics bucketing (#1982). A discoverable `localization` settings manifest for the org default is a follow-up; the resolver already reads the row if present. Tests: user pref > org default > UTC; invalid zone falls through; anonymous leaves it unset. Runtime suite green (387), spec kernel green (682). Closes #1978. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📓 Docs Drift CheckThis PR changes 2 package(s): 96 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
…#1992 Pre-existing red on the spec-liveness gate (not from this branch's timezone change): #1990 added flow.successMessage/errorMessage + action.errorMessage and #1992 added action.undoable, none classified in the ledgers. - flow.successMessage → live (service-automation/src/engine.ts:1292) - flow.errorMessage → live (service-automation/src/engine.ts:1348) - action.errorMessage → live (objectui toast, error counterpart of successMessage) - action.undoable → experimental: declared + demoed in #1992 but no runtime reader yet in framework or objectui (objectui has an UndoManager but does not key off the action's `undoable` flag). Promote to live once a consumer lands. Greens the liveness gate (was red on main too). Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Closes #1978. Foundation slice of ADR-0053 Phase 2.
What
Adds
ExecutionContext.timezone(optional IANA zone) and resolves it once per request inresolveExecutionContext, with precedence user preference → org default →UTC:sys_user_preferencerow(user_id, key='timezone').sys_setting(namespace='localization', key='timezone', scope='tenant'). One org per physical tenant (ADR-0002), so the row needs notenant_idfilter.tryFind, so timezone resolution never blocks auth.Why it's safe (pure plumbing, zero behavior change)
Nothing reads
ctx.timezoneyet, and an absent value resolves to'UTC'— exactly today's behavior. This is the keystone the rest of Phase 2 consumes:today()/daysFromNow()/daysAgo()(Those slices depend on this one for the
timezonevalue.)Notes
localizationsettings manifest for the org default is a small follow-up — the resolver already reads the row if present, so this lands without it.sys_member/ permission-set lookups. A caching pass can come later if needed.Testing
UTCwhen neither; an invalid zone falls through; anonymous requests leave it unset.@objectstack/runtimesuite green — 387 tests;@objectstack/speckernel green — 682; DTS build + typecheck clean.minor(new optionalExecutionContextfield + resolver).🤖 Generated with Claude Code