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-07-22] [$500] Distance - Search list displays old searched results in offline mode #30123
Version Number: 1.3.88-3 Reproducible in staging?: Yes Reproducible in production?: Yes 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: Applause - Internal Team Slack conversation:
Action Performed:
Go to staging.new.expensify.com
Go offline
Click on FAB> Request money> Distance tab
Select Start point
Enter any letter into search field
Expected Result:
Search result should update according to entered letter
Actual Result:
Search list displays old searched results in offline mode
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
changed the title [-]Distance - Search list displays old searched results in offline mode[/-][+][$500] Distance - Search list displays old searched results in offline mode[/+]on Oct 21, 2023
And then even if we change the input value, the request won't will be run in request function so dataSource state value doesn't change.
As a result, GooglePlaceAutocomplete compoment shows old search result.
And if we don't search anything and it turns to offline, the predefined places shows in GooglePlaceAutocomplete.
What changes do you think we should make in order to solve the problem?
Regarding discussion, we can filter recent destination by user's input in offline and send it as a props to GooglePlacesAutocomplete.
const filteredPredefinedPlaces = useMemo(() => {
console.log({predefinedPlaces: props.predefinedPlaces})
if (!props.network.isOffline || !searchValue) return props.predefinedPlaces.length < 5 ? props.predefinedPlaces : props.predefinedPlaces.slice(0, 5);
const filterRecentPlaces = props.predefinedPlaces.filter(value => !value?.description ? false :searchValue.split(" ").some((searchTerm) => value?.description.toLocaleLowerCase.includes(searchTerm.toLocaleLowerCase())))
return filterRecentPlaces.length < 5 ? filterRecentPlaces : filterRecentPlaces.slice(0, 5);
}, [
props.network.isOffline, props.predefinedPlaces, searchValue
])
return (
/*
* The GooglePlacesAutocomplete component uses a VirtualizedList internally,
* and VirtualizedLists cannot be directly nested within other VirtualizedLists of the same orientation.
* To work around this, we wrap the GooglePlacesAutocomplete component with a horizontal ScrollView
* that has scrolling disabled and would otherwise not be needed
*/
<>
<ScrollView
horizontal
contentContainerStyle={styles.flex1}
scrollEnabled={false}
// keyboardShouldPersistTaps="always" is required for Android native,
// otherwise tapping on a result doesn't do anything. More information
// here: https://github.com/FaridSafi/react-native-google-places-autocomplete#use-inside-a-scrollview-or-flatlist
keyboardShouldPersistTaps="always"
>
<View
style={styles.w100}
ref={containerRef}
>
<GooglePlacesAutocomplete
disableScroll
fetchDetails
suppressDefaultStyles
enablePoweredByContainer={false}
predefinedPlaces={filteredPredefinedPlaces}
changed the title [-][$500] Distance - Search list displays old searched results in offline mode[/-][+][HOLD for payment 2024-07-22] [$500] Distance - Search list displays old searched results in offline mode[/+]on Jul 15, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.6-8 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve 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:
[@eVoloshchak] The PR that introduced the bug has been identified. Link to the PR:
[@eVoloshchak] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
[@eVoloshchak] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
[@eVoloshchak] Determine if we should create a regression test for this bug.
[@eVoloshchak] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
[@mallenexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
The PR that introduced the bug has been identified. Link to the PR: N/A, this functionality wasn't implemented initially
The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: N/A
A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: this was already discussed in https://expensify.slack.com/archives/C01GTK53T8Q/p1716990791744559
Regression Test Proposal
Click on FAB> Submit Expense > Distance tab
Select different locations several times to populate the predefined places list
Turn off the internet connection
Select Start point
Start typing into the search field, verify the list is updated according to the search query
Activity
[-]Distance - Search list displays old searched results in offline mode[/-][+][$500] Distance - Search list displays old searched results in offline mode[/+]melvin-bot commentedon Oct 21, 2023
Triggered auto assignment to @mallenexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Oct 21, 2023
Job added to Upwork: https://www.upwork.com/jobs/~01a86156cf627cbc84
melvin-bot commentedon Oct 21, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)melvin-bot commentedon Oct 21, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak (
External)cooldev900 commentedon Oct 21, 2023
Proposal
from: @cooldev900
Please re-state the problem that we are trying to solve in this issue.
GooglePlacesAutocomplete shows old selected results in offline mode.
What is the root cause of that problem?
The route cause is that if the app turns to offline state, requestUrl.url becomes null and it couldn't send location filter request to google API.
App/src/components/AddressSearch/index.js
Line 400 in 6031f3e
https://github.com/FaridSafi/react-native-google-places-autocomplete/blob/ef107387c6846924423b832a242eee83cb07eed4/GooglePlacesAutocomplete.js#L158
https://github.com/FaridSafi/react-native-google-places-autocomplete/blob/ef107387c6846924423b832a242eee83cb07eed4/GooglePlacesAutocomplete.js#L508-L511
https://github.com/FaridSafi/react-native-google-places-autocomplete/blob/ef107387c6846924423b832a242eee83cb07eed4/GooglePlacesAutocomplete.js#L88-L125
And then even if we change the input value, the request won't will be run in request function so dataSource state value doesn't change.
As a result, GooglePlaceAutocomplete compoment shows old search result.
And if we don't search anything and it turns to offline, the predefined places shows in GooglePlaceAutocomplete.
What changes do you think we should make in order to solve the problem?
Regarding discussion, we can filter recent destination by user's input in offline and send it as a props to GooglePlacesAutocomplete.
App/src/components/AddressSearch/index.js
Line 345 in 6031f3e
App/src/pages/iou/WaypointEditor.js
Line 266 in 6031f3e
App/src/libs/actions/Transaction.ts
Line 100 in 6031f3e
What alternative solutions did you explore? (Optional)
N/A
Result
screen-capture.2.webm
shubham1206agra commentedon Oct 22, 2023
@cooldev900 This has not been merged yet
#29045
Can you send the video with your solution?
shubham1206agra commentedon Oct 22, 2023
If this is an upstream bug, @FaridSafi might help you with this
cooldev900 commentedon Oct 22, 2023
I will upload the video.
152 remaining items
[-][$500] Distance - Search list displays old searched results in offline mode[/-][+][HOLD for payment 2024-07-22] [$500] Distance - Search list displays old searched results in offline mode[/+]melvin-bot commentedon Jul 15, 2024
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.6-8 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 2024-07-22. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 15, 2024
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:
melvin-bot commentedon Jul 22, 2024
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
melvin-bot commentedon Jul 22, 2024
@eVoloshchak, @mallenexpensify, @neil-marcellini, @pac-guerreiro, @dubielzyk-expensify Eep! 4 days overdue now. Issues have feelings too...
mallenexpensify commentedon Jul 22, 2024
@eVoloshchak plz complete the BZ checklist above.
eVoloshchak commentedon Jul 24, 2024
Regression Test Proposal
Do we agree 👍 or 👎
mallenexpensify commentedon Jul 26, 2024
Contributor+: @eVoloshchak due $500 via NewDot
Test case
Thanks all!
JmillsExpensify commentedon Aug 6, 2024
$500 approved for @eVoloshchak