Skip to content

Fix Time Machine#1203

Merged
stevekuznetsov merged 1 commit into
NWACus:mainfrom
kevinherdez:kevinherdez/fixTimeMachine
Jul 2, 2026
Merged

Fix Time Machine#1203
stevekuznetsov merged 1 commit into
NWACus:mainfrom
kevinherdez:kevinherdez/fixTimeMachine

Conversation

@kevinherdez

Copy link
Copy Markdown
Collaborator

This adds a hard coded timestamp to the date that's set from Time Machine to keep API calls consistent.

We noticed an issue where depending on the time of day you change Time Machine, some APIs are returning different day results. The most noticeable example was the difference between the map-layer and products?avalanche_center=&date_start=&date_end= calls we're making. The reason is that fetchAvalancheForecast in useAvalancheForecast calls nominalForecastDate when fetching an avalanche forecast fragment. This calculates the date based off the avalanche center's expiry_time and changes the date based on if we know that the the avalanche center has a new forecast available.

The fix here forces the calls to be made within the same day so that there's no mismatch by adding a timestamp to the date instead of using the on device timestamp. This is only used for testing in Time Machine so it should give us the results we want even if under the hood we're potentially showing "wrong" data.

@stevekuznetsov stevekuznetsov added this pull request to the merge queue Jul 2, 2026
Merged via the queue into NWACus:main with commit e999faf Jul 2, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants