You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[HOLD for payment 2024-01-16] [$500] Web - IOUs - location text does not change on selecting 'Use current location' #33016
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review
Version Number: v1.4.12-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 Expensify/Expensify Issue URL: Issue reported by: Slack conversation: @
Action Performed:
Open the app
Click on green plus and click request money -> distance
Open start/finish
Search any location and select the result
Again open same field used in step 3
Ensure that location action is disabled
Remove current location text and select 'Use current location', it will trigger error
Now enable location access and again select 'Use current location'
Observe now that on main distance page, it still displays older location instead of 'Your location', open the same field as step 3 and observe that inside it displays 'Your location' properly
Expected Result:
App should display 'Your location' on selecting 'Use current location' in any waypoint
Actual Result:
App displays older location value instead of 'Your location' on selecting 'Use current location' in any waypoint if location access is enabled after error is triggered
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Web - IOUs - location text does not change on selecting 'Use current location'[/-][+][$500] Web - IOUs - location text does not change on selecting 'Use current location'[/+]on Dec 13, 2023
What alternative solutions did you explore? (Optional)
As alternative, we can pass name param (CONST.YOUR_LOCATION_TEXT or null ) or set name === null by default in Transaction.saveWaypoint (But since we use Transaction.saveWaypoint in two places. It is not very required )
Please re-state the problem that we are trying to solve in this issue.
App displays older location value instead of 'Your location' on selecting 'Use current location' in any waypoint if location access is enabled after error is triggered
What is the root cause of that problem?
we don't pass the name field to the location here.
So that the name field will be undefined. Currently, when updating waypoints we are using MERGE method, and the old name value will be retained. It caused this bug
What changes do you think we should make in order to solve the problem?
We can combine the old transaction and the new change, then use SET method instead of MERGE method as we did here #30290 (comment)
Note that: MERGE method caused many similar bugs so we usually use SET method when updating waypoints like here
Please re-state the problem that we are trying to solve in this issue.
Web - IOUs - location text does not change on selecting 'Use current location'
What is the root cause of that problem?
We use 'Onyx.merge()' to update the 'waypoint' object, but the 'Onyx.merge()' will ignore the property with 'undefined' value, so in this case, all properties in 'waypoint' will be updated except the 'name' property.
What changes do you think we should make in order to solve the problem?
changed the title [-][$500] Web - IOUs - location text does not change on selecting 'Use current location'[/-][+][HOLD for payment 2024-01-16] [$500] Web - IOUs - location text does not change on selecting 'Use current location'[/+]on Jan 10, 2024
@kaushiktd can you clarify what specifically you are expecting payment for? No payment is due on this issue as your proposal was not selected and you were not hired for this job. For more context into how and when Expensify issues payment please see contributing.md
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in review
Activity
melvin-bot commentedon Dec 13, 2023
Triggered auto assignment to @stephanieelliott (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.[-]Web - IOUs - location text does not change on selecting 'Use current location'[/-][+][$500] Web - IOUs - location text does not change on selecting 'Use current location'[/+]melvin-bot commentedon Dec 13, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0168cfb95cbebc1039
melvin-bot commentedon Dec 13, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Dec 13, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mananjadhav (
External)ZhenjaHorbach commentedon Dec 13, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Web - IOUs - location text does not change on selecting 'Use current location'
What is the root cause of that problem?
We don't pass name param
App/src/components/AddressSearch/index.js
Lines 338 to 342 in 3df907c
As a result we pass undefined value inside
Transaction.saveWaypointApp/src/pages/iou/request/step/IOURequestStepWaypoint.js
Line 169 in 3df907c
As a result, the previous value is used
What changes do you think we should make in order to solve the problem?
In order to fix this, we can use the implementation from WaypointEditor
we can set
name: values.name || null,App/src/pages/iou/request/step/IOURequestStepWaypoint.js
Line 169 in 3df907c
Plus here(optional)
App/src/pages/iou/request/step/IOURequestStepWaypoint.js
Line 143 in 3df907c
Like here
App/src/pages/iou/WaypointEditor.js
Line 167 in 3df907c
What alternative solutions did you explore? (Optional)
As alternative, we can pass name param (CONST.YOUR_LOCATION_TEXT or null ) or set name === null by default in
Transaction.saveWaypoint(But since we use Transaction.saveWaypoint in two places. It is not very required )App/src/components/AddressSearch/index.js
Lines 338 to 342 in 3df907c
DylanDylann commentedon Dec 14, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
App displays older location value instead of 'Your location' on selecting 'Use current location' in any waypoint if location access is enabled after error is triggered
What is the root cause of that problem?
we don't pass the name field to the location here.
App/src/components/AddressSearch/index.js
Lines 338 to 342 in b950c1e
So that the
namefield will be undefined. Currently, when updating waypoints we are usingMERGEmethod, and the oldnamevalue will be retained. It caused this bugWhat changes do you think we should make in order to solve the problem?
In here
App/src/libs/actions/Transaction.ts
Line 61 in b950c1e
We can combine the old transaction and the new change, then use SET method instead of MERGE method as we did here
#30290 (comment)
Note that: MERGE method caused many similar bugs so we usually use SET method when updating waypoints like here
App/src/libs/actions/Transaction.ts
Line 162 in b950c1e
What alternative solutions did you explore? (Optional)
If we still use MERGE method, I think we should have a general solution instead of fixing case by case (It is so easy to miss similar bugs elsewhere)
App/src/libs/actions/Transaction.ts
Line 61 in b950c1e
In here we can check if the name field is undefined we will set it to null or address field
kaushiktd commentedon Dec 14, 2023
Please re-state the problem that we are trying to solve in this issue.
Web - IOUs - location text does not change on selecting 'Use current location'
What is the root cause of that problem?
When we select use current location name field value show as undefined in
selectWaypointhttps://github.com/Expensify/App/blob/main/src/pages/iou/request/step/IOURequestStepWaypoint.js#L169
name: [values.name],What changes do you think we should make in order to solve the problem?
https://github.com/Expensify/App/blob/main/src/pages/iou/request/step/IOURequestStepWaypoint.js#L169
Implement more robust handling of undefined values for name in the
Transaction.saveWaypointmethod by providing a default value explicitly:name: [values.name](http://values.name/) !== undefined ? [values.name](http://values.name/) : CONST.YOUR_LOCATION_TEXT,This code explicitly checks for undefined values and assigns
CONST.YOUR_LOCATION_TEXTas a fallback to ensure consistency.Video:-
https://drive.google.com/file/d/1gl9HvRNJUpybpImBi6ey1z4u-ktt-tNd/view?usp=sharing
allstarsmen commentedon Dec 14, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Web - IOUs - location text does not change on selecting 'Use current location'
What is the root cause of that problem?
We use 'Onyx.merge()' to update the 'waypoint' object, but the 'Onyx.merge()' will ignore the property with 'undefined' value, so in this case, all properties in 'waypoint' will be updated except the 'name' property.
What changes do you think we should make in order to solve the problem?
In here
App/src/libs/actions/Transaction.ts
Line 60 in b950c1e
We should set the name of the current location to an empty string.
What alternative solutions did you explore? (Optional)
No
Result
Before.mov
After.mov
36 remaining items
[-][$500] Web - IOUs - location text does not change on selecting 'Use current location'[/-][+][HOLD for payment 2024-01-16] [$500] Web - IOUs - location text does not change on selecting 'Use current location'[/+]mananjadhav commentedon Jan 19, 2024
I couldn't pinpoint the specific PR that must've caused this. I also don't think we need a regression test for this.
@stephanieelliott This is ready for payout, can you please post a payment summary?
stephanieelliott commentedon Jan 19, 2024
Summarizing payment on this issue:
Upwork job is here: https://www.upwork.com/jobs/~1737876297360310272"
kaushiktd commentedon Jan 20, 2024
@stephanieelliott When should I expect payment?
mananjadhav commentedon Jan 20, 2024
@kaushiktd Payment regarding?
kaushiktd commentedon Jan 21, 2024
Yes @mananjadhav
JmillsExpensify commentedon Jan 22, 2024
$500 payment approved to @mananjadhav based on this comment.
kaushiktd commentedon Jan 23, 2024
@JmillsExpensify any update on my payment?
stephanieelliott commentedon Jan 23, 2024
@kaushiktd can you clarify what specifically you are expecting payment for? No payment is due on this issue as your proposal was not selected and you were not hired for this job. For more context into how and when Expensify issues payment please see contributing.md
kaushiktd commentedon Jan 23, 2024
It seems I made a mistake. Sorry! I misunderstood this issue for the one I got selected. 😅