-
Notifications
You must be signed in to change notification settings - Fork 114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug Fix] Leaflet gets broken after updating labels #1137
Conversation
It triggers an error with re-rendering after the trip information gets changed (ex) changing label
@JGreenlee @shankari Please check this PR 🙏 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1137 +/- ##
=======================================
Coverage 77.49% 77.49%
=======================================
Files 29 29
Lines 1693 1693
Branches 370 370
=======================================
Hits 1312 1312
Misses 381 381
Flags with carried forward coverage won't be shown. Click here to find out more. |
LGTM! Once Jack reviews, I will merge |
@JGreenlee tagging you for review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works well and looks good to me.
I tested this locally in the devapp because I wanted to make sure the color of the trajectory updates if the mode changes from one base mode to another (for example, bike -> car changes from green to red)
@JGreenlee @jiji14 just to check, why was this not caught by the unit tests? It is a 100% reproducible bug for a fairly common function. Do we not have a test that pretends to click the button and label the trip? |
@shankari I think we would have needed integration testing or end-to-end testing for this to have been caught. We started with integrating Appium, but it is a significant effort. After encountering roadblocks with setup, we have not been able to prioritize it since there have been more urgent tasks lately I have been loosely formulating a plan which I think would make integration testing more easily achievable, which is to support a version of the UI that runs as an Expo web app, detached from the native code. Because it would be web-only, we could test the full extent of its capability, including integration testing with actual server calls. |
the web compatibility layer is an interesting idea and definitely the standard approach towards software based testing (e.g. creating mock/proxies/hardware abstraction layer). It would be interesting to see how thick the layer would need to be. If we are not testing the data collection, maybe only the usercache and the server calls. Would be great to have the web version "in our back pockets" in case there is a request for it. |
Overview
After optimizing the Leaflet map, a bug appears when updating labels.
We cache the map after rendering a Leaflet map and reset the
leafletMapRef
. However, when the map information changes, we need to re-render the map usinginitMap
. Currently, this doesn't happen because we resetleafletMapRef
, causing it to fail the conditional check.Before
After
Screen.Recording.2024-03-19.at.1.02.00.PM.mov