-
Notifications
You must be signed in to change notification settings - Fork 226
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1931963 - Add UniFFI bindings for fetch_geonames() in suggest
I didn't expect to be adding bindings for this, and there might be better ways to support the use case described in bug than exposing `fetch_geonames()` as is, but this works for now at least, and we need a fix for Firefox 134. Desktop will call this to validate cities and states returned by the Yelp ML model. Not only to validate but also to do prefix matching, since we can get that for free. I considered adding a new function that matches both cities and regions at once so that desktop doesn't need to call into suggest twice and ideally so that we run only one SQL query. But I don't really like the idea of having a completely different code path for this. Or, it might be possible to rewrite the current function so it works that way. But that ends up getting a little messy pretty quickly. So for now I did the simplest thing. I also considered making geonames a full-fledged `SuggestionProvider` and `Suggestion`, but then we'd have to add more options to `SuggestionProviderConstraints` to support the `fetch_geonames()` params, and these aren't really standalone suggestions anyway.
- Loading branch information
Showing
5 changed files
with
200 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.