-
Notifications
You must be signed in to change notification settings - Fork 3.2k
[Waiting for C+ payment] [$500] Android - Wrong location briefly shows before San Francisco when first open Distance request page #27087
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
Comments
Job added to Upwork: https://www.upwork.com/jobs/~014793e3b4669749b9 |
Triggered auto assignment to @sonialiap ( |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to @kadiealexander ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Wrong location briefly shown on the map before the default initial location, San Francisco the first time the Distance request page is open. What is the root cause of that problem?This seems to be an issue specific to how the default location is set with the Mapbox SDK on Android. It is easily reproducible after launching the app for the first time. It seems when the camera (used for displaying the map viewport) is initialised for the first time, it has to move the camera center to the new location from Atlantic City (the default center if none is set). On subsequent attempts to open the distance request screen, San Francisco remains the center, so the camera does not have to move. What changes do you think we should make in order to solve the problem?There is a callback to set the map idle state, which indicates that the map is ready for interaction and updates. We can render an overlay (or the blocking view, but rendered on top of the map) in DistanceRequest before the first call to set the map idle state, and then hide the overlay when the This overlay will hide the initial camera movement from Atlantic City to San Francisco, and then when the map is ready (idle), the overlay gets hidden. A loading indicator or animation can be added to the overlay, if required. This can be achieved with the following steps.
const setMapIdle = (e: MapState) => {
if (e.gestures.isGestureActive) return;
setIsIdle(true);
+ if (onMapReady) {
+ onMapReady();
+ }
};
{!isOffline && Boolean(mapboxAccessToken.token) ? (
+ <>
<MapView
...
+ onMapReady={useCallback(() => {
+ if (!isMapReady) {
+ setIsMapReady(true);
+ }
+ }, [])}
/>
+ {!isMapReady && <View style={styles.mapViewOverlay} />}
+ </>
)
Since similar changes will also need to be made to the ConfirmedRoute component, we can consider creating a separate component for this, This only happens on Android, so we should consider creating a platform-specific The included demo video below shows what it would look like with the What alternative solutions did you explore? (Optional)I tried setting the demo-27087-blocking-view.webm |
ProposalPlease re-state the problem that we are trying to solve in this issue.During launching the map, we can see the default position of the camera with default coordinates What is the root cause of that problem?The main problem is the coordinate value, which can be undefined for a short time during initialization of the map. What changes do you think we should make in order to solve the problem?In Mapbox.Camera, we don't need to pass dynamic values inside the defaultSettings.centerCoordinate. App/src/components/MapView/MapView.tsx Lines 70 to 76 in b11bddc
Instead, we can use centerCoordinate and use constant with value [-122.4021, 37.7911](San Francisco) for defaultSettings.centerCoordinate.
What alternative solutions did you explore? (Optional)NA |
@mollfpr we have a couple proposals, what do you think? |
@akinwale @ZhenjaHorbach Why it's only happening on Android?
@ZhenjaHorbach Is this a problem in the upstream or our component? I have a hard time confirming the issue. Does anyone have a suggestion? |
@mollfpr But perhaps the map on Android is much more demanding on hardware compared to other platforms |
This is not actually a fix for the issue. I tested this and it is still reproducible even after setting the coordinates directly in MapView.tsx.
It seems that the Mapbox SDK for Android is not as performant as other platforms probably due to different device configurations in terms of processor speed and available memory. I can easily reproduce the issue in the Android 11 emulator. In order to reproduce the behaviour reliably, close the app completely (also remove from recents), relaunch the app and then try to create a Distance request. You will notice the map moving from the initial location the first time the map loads. This only happens the first time. If you try to create another Distance request during the same app session, it will be centered on San Francisco already. |
@akinwale Therefore, it is logical to overwrite this value with the one we need |
default-location-flash.webmYou'll notice around the 0:31 / 0:32 mark that the default location (Atlantic City) flashes and renders for a bit before the map moves to the center coordinate (San Francisco). |
Oh yeah |
I'm okay with @akinwale proposal to cover the map component until it's ready (idle). I tried to find a similar issue on the upstream, but no one cares much about it, and it's tough to notice. Also, this issue polishes the map render and does not block the user from using the distance request feature. I would like to hear the opinion of the internal engineer. So I'm recommending to consider @akinwale proposal. 🎀 👀 🎀 C+ reviewed! |
Triggered auto assignment to @tylerkaraszewski, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
@sonialiap Add a note for the speed bonus calculation. The assignment is on 14th Sept GMT+7, and the PR merged on 15th Sept GMT+7.
No offending PRs. This is an improvement for the Request money distance feature.
The regression step should be enough.
|
@JmillsExpensify , can you confirm that @mollfpr is setup for payment via NewDot? If so I'll drop a note in #bug-zero with an updated list of everyone |
@tylerkaraszewski, @akinwale, @sonialiap, @mollfpr, @kadiealexander Huh... This is 4 days overdue. Who can take care of this? |
Not overdue. @mollfpr please let us know how you'd prefer to be paid. |
@kadiealexander I would love to get this pay in NewDot, but I am still waiting for the confirmation #27087 (comment). |
Confirming @mollfpr can be paid via NewDot. The SO is updated and the associated sheet. |
@mallenexpensify I guess I can create the request in the NewDot now? |
Yes @mollfpr , please do, based on the instructions I sent you last week. Thx |
Yes. |
$750 payment approved for @mollfpr based on BZ summary. |
@tylerkaraszewski @akinwale @sonialiap @mollfpr @kadiealexander this issue is now 4 weeks old and preventing us from maintaining WAQ, can you:
Thanks! |
Job added to Upwork: https://www.upwork.com/jobs/~0106c2a9461a735378 |
Uh oh!
There was an error while loading. Please reload this page.
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
Expected Result:
Shows San Francisco as default location
Actual Result:
Weird location briefly shows before directing to San Francisco
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.63.0
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
bug.2.mov
Expensify/Expensify Issue URL:
Issue reported by: @situchan
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693888204337759
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: