-
-
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
fix(mobile): fix text search #14873
base: main
Are you sure you want to change the base?
fix(mobile): fix text search #14873
Conversation
Label error. Requires exactly 1 of: changelog:.*. Found: |
if (isContextualSearch.value) { | ||
filter.value = filter.value.copyWith( | ||
filename: null, |
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.
if you don't send null, the search will be incorrect
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.
why?
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.
immich/mobile/lib/services/search.service.dart
Lines 82 to 85 in c3be74c
originalFileName: | |
filter.filename != null && filter.filename!.isNotEmpty | |
? filter.filename | |
: null, |
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.
What do you reference there?
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.
where the filename filter is being used
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.
and the empty string is necessary because if you copyWith null you will get the previous value
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.
They should be set null. I'm not sure if the server treats an empty string like null in this case, and in general a lack of a value should be represented with null instead of an empty string.
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.
@mertalev the server doesn't get an empty string, it gets null, read the referenced code
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.
that's what I mean when I said
The SearchService handles it by checking if the strings context and filename are empty.
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.
Oh, I see. It seems like a weird limitation to not be able to change an earlier value to null. Not sure if there's a better way to handle that, but I guess this is okay for now if there isn't.
This commit f59b813 changed how Passing empty string at the context or the filename filter is necessary to remove the filter when the user submits the search field with no text. The I think this answers both of the above questions. |
Fixes #14814