-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Use new Search query syntax when calling api #46481
Use new Search query syntax when calling api #46481
Conversation
@luacmartins this is just a draft but there is 1 issue with offset that I need your help with. Problems right now:
rec-offset.mp4Take a look at this on your end and tell us what is the preferred way to send offset. |
@Kicu the way you described in 1 is the correct way to send it. I noticed that we have a bug in the backend that's not correctly parsing the new offset input. I'll work on a fix for that. |
I have a PR up that fixes the bug. I'll let you know once that's deployed and fixed. For now, please continue with option 1. |
@rayane-djouah Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
super simple and ready for review |
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-08-01.at.12.16.07.PM.movAndroid: mWeb ChromeScreen.Recording.2024-08-01.at.12.11.27.PM.moviOS: NativeSimulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-08-01.at.12.01.44.mp4iOS: mWeb SafariSimulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-08-01.at.11.55.33.mp4MacOS: DesktopScreen.Recording.2024-08-01.at.11.55.45.AM.mov |
Bug (Regression): Expenses are not grouped into IOU reports (in "Shared", "Drafts", and "Finished" tabs), and some expenses are missing (this is already known based on the above). There are differences between the staging and development versions. Please look at the screenshots below for both versions: 1- "Shared" Results:
2- "Drafts" Results:
3- "Finished" Results:
|
Taking a look to see if my backend PR will solve the issue above |
Ok, I see the issue. The backend is returning the wrong type. I put up a PR with a temporary fix until we convert the frontend to use |
@rayane-djouah for now, we can continue review assuming the issue is resolved. |
@Kicu - Do you know why the search API request runs twice (with the same payload) every time I open the page or filter the expenses? |
I've noticed that too and it has been an issue on main. I'll create an issue to fix that |
Created issue here for the duplicate requests |
isn't the double call simply because of |
Oh, that makes sense. I forgot about Strict Mode! 😄 I just tested it with Strict Mode disabled, and the duplicate requests is not happening 👍 |
Oh and btw I've found a bug where our logic displaying sorting no longer makes sense and Im fixing it. Will push some new code in like ~15minutes, and then you can re-check. |
@rayane-djouah @luacmartins some context for newest commit:
Hope that makes it clear. All this parsing logic is still a bit complex 😅 but I think we will simplify it further, we're just learning which functions we really need in the code |
Nice. Thanks for catching that! It seems like TS checks are failing though |
@@ -170,15 +168,10 @@ function Search({queryJSON, policyIDs, isCustomQuery}: SearchProps) { | |||
const sortedData = SearchUtils.getSortedSections(type, data, sortBy, sortOrder); | |||
|
|||
const onSortPress = (column: SearchColumnType, order: SortOrder) => { | |||
const currentSearchParams = SearchUtils.getCurrentSearchParams(); | |||
const currentQueryJSON = SearchUtils.buildSearchQueryJSON(currentSearchParams.q, policyIDs); |
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.
Note: I removed this because it was super redundant. We already have the parsed queryJSON
object in this component's props. Instead of using it we were getting the params and parsing them once again which didn't add anything to this function.
TS fixed |
@Kicu @luacmartins The filtering by policyIDs is currently broken. Should we leave it as is and address it in #46592, or should we implement a temporary fix here? |
That's a regression, we could keep sending the policyID as a temporary solution. The real fix will be implemented as part of #46592 |
@rayane-djouah @luacmartins I pushed a fix and rec-web-policyids.mp4 |
@Kicu - Did you push your latest changes? I see that we're still not sending the |
@rayane-djouah sorry 😅 Indeed forgot to push, its ok now |
@@ -134,19 +137,6 @@ function Search({queryJSON, policyIDs, isCustomQuery}: SearchProps) { | |||
setDeleteExpensesConfirmModalVisible(true); | |||
}; | |||
|
|||
useEffect(() => { |
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.
this was a duplicate of useEffect in line 96 - probably someone made a mistake when refactoring
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.
LGTM and tests well apart from this bug
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.
LGTM! The remaining bug will be fixed after the next API deploy today.
@luacmartins - Could you please create a payment issue for this PR? Thank you! |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
Created here |
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.0.16-0 🚀
|
The bug is fixed after the API deploy 🚀 |
oh hai! We've got this deploy blocker - #46720 - which seems very related (sort order doesn't actually change anything); I just tried the behavior on the production branch and it still is incorrect, so I think it's either a backend issue or a regression that wasn't caught before. Butttttt feels like you all might have some insight into a fix! @luacmartins do you think it might be backend? Did we merge something recently? |
🚀 Deployed to production by https://github.com/marcaaron in version: 9.0.16-8 🚀
|
Details
/search
api endpointNOTE: there is bug on backend right now that only returns first page of results and ignores offset. @luacmartins is aware and PR fixing this is in progress. When reviewing please temporarily ignore that backend returns
offset: 0
.Fixed Issues
$ #46684
PROPOSAL:
Tests
/search/filters
and choose some filters, click ViewResults/search
request is sent, payload has an object with all the filter values insideOffline tests
QA Steps
/search/filters
and choose some filters, click ViewResults/search
request is sent, payload has an object with all the filter values insidePR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
rec-web-query-api.mp4
MacOS: Desktop