Repository navigation
Bug #83031, EM task options fail to load when the task time zone is not in the zone list - #9205
Conversation
…ck to a computed offset Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Review r1 (lead's reviewer), head 8073ac1: CLEAN. taskOptionsPaneModel.timeZone is the IANA id; the added option is guarded against duplicates (listed zone or browser zone) and re-added after save; fallback offset getTimeZoneOffset(tz)/60000 is east-positive and now-based, the same convention as TimeZoneModel.minuteOffset, so no date shift. Specs: date-type-formatter 15, task-options-pane 28, time-zone.service.tl + schedule-task-editor-page.tl 56 pass / 3 expected-fail / 1 skipped. Web-only change (no Java gate). |
Nelson-cao
left a comment
There was a problem hiding this comment.
Verdict
Ready to merge (head 8073ac1). No blocking issues.
Open verdicts from the conversation
none. The only comment is a CLEAN review (r1) at the current head.
Committed secrets
none (single commit, web TS/spec changes only).
Tests run
no trigger fired (web-only change, no Java/pom, no PR-named test command). Author reports vitest runs; not re-run by me.
Findings
Non-blocking:
TimeZoneService.updateTimeZoneOptionsnow callscreateTimeZoneOption(taskTimeZoneId, null), which usesIntl.DateTimeFormatwith the zone and throws RangeError for an invalid id.getMinuteOffsetguards this with try/catch, but the new add path does not. The task zone comes from the server so an invalid id is unlikely, but a try/catch would match the defensive fallback in the formatter.- The duplicate check compares by id only (no label), which is correct for the task-level zone; fine.
- Fix is minimal, call sites are backward compatible (optional third param; cycle editor/portal unchanged), fallback offset uses the same "now"-based east-positive convention as the listed options. Tests cover the new paths.
Cause
Opening an EM schedule task whose task-level time zone is not in the server's zone list (e.g.
America/New_York; onlyUS/Easternis listed) and that has start/stop dates threw inDateTypeFormatter.getMinuteOffset(resultundefined ->reading 'minuteOffset') inside theTaskOptionsPaneset modelsetter. The setter aborted before owner/description/locale/time zone were bound, so the pane showed "Invalid user", an empty description, Default locale and Save was disabled.TimeZoneService.updateTimeZoneOptionsonly added the local zone and condition zones, never the task zone.Fix
updateTimeZoneOptions(options, conditions, taskTimeZoneId?)adds the task zone (viacreateTimeZoneOption) when missing, before the no-conditions early return. The EM schedule-task-editor-page passestaskOptionsPaneModel.timeZoneon load and after save. Cycle editor and portal callers are unchanged.getMinuteOffsetfalls back togetTimeZoneOffset(tz) / 60000when the zone is not listed, returning 0 for an invalid id instead of throwing.Not included: NG0955 track change
The NG0955 warning comes from the pre-existing local-zone option sharing an id with a listed zone. Selection identity uses
compareWith(id + label), so it is unrelated to this bug and left for a separate issue.DST note
Offsets are "now"-based, the same definition as the server
TimeZoneModellist andgetTimeZoneOffset, so a synthesized option behaves like a listed one; conversions stay symmetric.Tests (vitest, all exit 0; the new cases fail without the production change)
date-type-formatter.spec.ts: 15 passed (3 new failed before the fix)time-zone.service.tl.spec.ts: 28 passed, 1 skipped (3 new)task-options-pane.component.spec.ts: 28 passed (1 new)schedule-task-editor-page.component.tl.spec.ts: 28 passed, 3 expected fail (1 new)Regression case: test/regression/plugin-admin/automated/schedule-tasks/bug-em-options-time-zone-outside-list.test.js (named in the issue; not present on wiz origin/main at the time of this PR)
🤖 Generated with Claude Code