Fix iOS Live Activity showing old distance unit after workspace settings change#84550
Conversation
|
|
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@parasharrajat Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6589bf6d06
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@GCyganek can you address the AI comments? |
On it EDIT: ready |
|
@dukenv0307 should review this PR right as it's from the Live activity PR? |
|
@trjExpensify I'll review it |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-03-09.at.22.51.27.movAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8cfe5e5c31
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @AndrewGable has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
…date-distance-unit-live-activity Fix iOS Live Activity showing old distance unit after workspace settings change (cherry picked from commit 2879146) (cherry-picked to staging by luacmartins)
|
🚀 Cherry-picked to staging by https://github.com/luacmartins in version: 9.3.33-5 🚀
|
|
Fixed in iPhone13/26.3.1, v9.3.33-5 ScreenRecording_03-09-2026.15-38-22_1.MP4 |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.33-5 🚀
|
|
🚀 Cherry-picked to staging by https://github.com/luacmartins in version: 9.3.34-0 🚀
|
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.34-2 🚀
|
Explanation of Change
The iOS Live Activity for GPS distance tracking stored distanceUnit and distanceUnitLong as ActivityKit attributes, which are immutable after the activity starts. When users changed the distance unit in workspace settings mid-trip, the in-app display correctly reflected the new unit, but the Live Activity in the notification panel / Dynamic Island continued showing the old unit.
This PR moves distanceUnit and distanceUnitLong from GpsTripAttributes (immutable) to GpsTripAttributes.ContentState (updatable), allowing the unit to be dynamically updated when it changes. The Live Activity widget now reads the unit from context.state instead of context.attributes.
Additionally, a new updateGpsTripNotificationUnit function is added that immediately pushes a Live Activity state update when the workspace distance unit setting changes while a GPS trip is active.
Fixed Issues
$ #84518
PROPOSAL: N/A
MOBILE-EXPENSIFY: https://github.com/Expensify/Mobile-Expensify/pull/13883
Tests
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
iOS: Native
Screen.Recording.2026-03-09.at.10.10.51.mov