-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[HOLD for payment 2023-11-29] [$500] Distance Request – The map is zoomed incorrectly after adding description #29469
Comments
Triggered auto assignment to @NicMendonca ( |
Job added to Upwork: https://www.upwork.com/jobs/~011040976b36d481db |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to Contributor-plus team member for initial proposal review - @Santhosh-Sellavel ( |
Proposal by: @paultsimura ProposalPlease re-state the problem that we are trying to solve in this issue.After opening "Description" editor on Distance Request confirmation, the map is incorrectly zoomed. What is the root cause of that problem?The root cause of this is that we use the ResizeObserver to resize the map. It's a good thing that was added in #27574 to fix the map being cut off. App/src/components/MapView/MapView.web.tsx Lines 27 to 51 in 05ab7ed
Then, mapRef.resize() is called here:
So the map is being resized after the boundaries have been reset. What changes do you think we should make in order to solve the problem?First, we should split this hook into a function const resetBoundaries = useCallback(() => {
...current hook content here...
}, [waypoints, mapRef, mapPadding, directionCoordinates]);
useEffect(resetBoundaries, [resetBoundaries]); App/src/components/MapView/MapView.web.tsx Lines 27 to 51 in 05ab7ed
And then, we should call resetBoundaries() after the resize:
const resizeObserver = new ResizeObserver(() => {
mapRef.resize();
+ resetBoundaries();
}); Result:https://user-images.githubusercontent.com/12595293/274435387-c286a5c8-9789-4fd9-98c7-025705352aef.mov What alternative solutions did you explore? (Optional) |
ProposalPlease re-state the problem that we are trying to solve in this issue.After opening "Description" editor on Distance Request confirmation, the map is incorrectly zoomed. What is the root cause of that problem?The root cause of this is that we use the ResizeObserver to resize the map. It's a good thing that was added in #27574 to fix the map being cut off. However, we are facing a race condition when opening a map back from the "Distance" tab. First, the boundaries are reset by this hook: App/src/components/MapView/MapView.web.tsx Lines 27 to 51 in 05ab7ed
Then, App/src/components/MapView/MapView.web.tsx Lines 53 to 66 in d2c8456
So the map is being resized after the boundaries have been reset. What changes do you think we should make in order to solve the problem?First, we should split this hook into a function const resetBoundaries = useCallback(() => {
...current hook content here...
}, [waypoints, mapRef, mapPadding, directionCoordinates]);
useEffect(resetBoundaries, [resetBoundaries]); App/src/components/MapView/MapView.web.tsx Lines 27 to 51 in 05ab7ed
And then, we should call const resizeObserver = new ResizeObserver(() => {
mapRef.resize();
+ resetBoundaries();
}); App/src/components/MapView/MapView.web.tsx Lines 58 to 60 in d2c8456
Result:web.movP.s. Since the resize happens only on a tab change, this will be a safe addition, which will also solve the issue of not resetting the zoom of the map when navigating back to the initial waypoints selection page. This one: bug-map-resize-comeback.movWhat alternative solutions did you explore? (Optional)P.p.s. thank you @kbecciv, I've reposted my proposal just to keep better formatting, as Slack messes it up a little bit. |
@Santhosh-Sellavel proposals for ya! |
@kbecciv @NicMendonca Can you check again, this seems to be working fine already! |
@Santhosh-Sellavel did you test on Web/mWeb? Native platforms use different SDK and it's not reproducible there. Also, this was reproduced just now (both staging and prod): |
mWeb/web |
Please also make sure to use the points that are relatively close (the ones from the issue description are a perfect match). The zoom lag on large distances is not that noticeable. |
Alright got it, thanks @paultsimura! |
@paultsimura #29469 (comment) looks good to me! C+ Reviewed |
Triggered auto assignment to @deetergp, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.1-13 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue: If no regressions arise, payment will be issued on 2023-11-29. 🎊 After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
|
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
|
@deetergp a friendly bump on the payout here, please☝️ |
BZ Payment summary: @Santhosh-Sellavel don't forget to request payment via Expensify! @paultsimura you've been paid via Upwork! |
@Santhosh-Sellavel bump on this! #29469 (comment) |
@deetergp, @paultsimura, @NicMendonca, @Santhosh-Sellavel Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
|
Bug: Distance Request – The map is zoomed incorrectly after adding a description Regression Steps
|
Thanks @Santhosh-Sellavel!
|
Request On ND |
$500 payment approved for @Santhosh-Sellavel based on comment above. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 1.3.83.1
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
Expensify/Expensify Issue URL:
Issue reported by: @paultsimura
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1697062856852229
Action Performed:
Expected Result:
The route is within the map boundaries.
Actual Result:
The map is zoomed a bit too much, the route doesn't fit the map.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
RPReplay_Final1697063034.MP4
MacOS: Chrome / Safari
bug-map-resize.mov
Recording.4972.mp4
MacOS: Desktop
bug-map-resize-desktop.mov
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: