Skip to content

fix(inspection): resolve timezone offset fallback to UTC by unifying to timezoneShiftHours - #978

Merged
kyasbal merged 1 commit into
GoogleCloudPlatform:mainfrom
K53:push-tlyymwontmks
Sep 9, 2026
Merged

fix(inspection): resolve timezone offset fallback to UTC by unifying to timezoneShiftHours#978
kyasbal merged 1 commit into
GoogleCloudPlatform:mainfrom
K53:push-tlyymwontmks

Conversation

@K53

@K53 K53 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Background

Following the Connect-RPC migration (#908), the timezone shift parameter was changed to timezoneShiftHours. However, references to the legacy timezoneShift key remained in TimeZoneShiftInputTask and the frontend client, causing timezone offsets to always fall back to UTC.

What changed

Ensured that browser/request timezone offsets are correctly propagated to TimeZoneShiftInputTask, so that inspection form defaults (such as End time) and log queries properly reflect the local timezone instead of defaulting to UTC. Also added unit tests for TimeZoneShiftInputTask.

…to timezoneShiftHours

Following the Connect-RPC migration (GoogleCloudPlatform#908), the timezone shift parameter
was updated in Protobuf and backend RPC handlers to timezoneShiftHours
(float64). However, TimeZoneShiftInputTask and the frontend InspectionClient
retained references to the legacy timezoneShift key, causing inspections
to always fall back to UTC time.

This change:
- Unifies the context key to TaskInputKeyTimezoneShiftHours in inspectioncore
- Updates TimeZoneShiftInputTask to read TaskInputKeyTimezoneShiftHours
- Updates backend-api.service.ts and its test to use timezoneShiftHours
- Updates parser_test.go to float64(9)
- Adds unit tests for TimeZoneShiftInputTask
@K53 K53 added the type:bug Something isn't working as expected label Sep 9, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the timezone shift parameter handling by renaming the parameter from "timezoneShift" to "timezoneShiftHours" across both the frontend and backend codebases. It introduces a central constant TaskInputKeyTimezoneShiftHours in the backend contract, simplifies the timezone shift parsing logic in TimeZoneShiftInputTask, and adds a comprehensive suite of unit tests for this task. All references in tests and API clients have been updated accordingly. I have no feedback to provide.

@kyasbal
kyasbal added this pull request to the merge queue Sep 9, 2026
Merged via the queue into GoogleCloudPlatform:main with commit e5569a8 Sep 9, 2026
17 checks passed
@K53
K53 deleted the push-tlyymwontmks branch September 9, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants