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
Fixes DISCO-2470: Implement the foundation of a Firefox Suggest component #5723
Commits on Jul 20, 2023
-
Initial scaffolding for a Suggest component.
This commit adds a new component to fetch search suggestions from Remote Settings and store them in an SQLite database.
Configuration menu - View commit details
-
Copy full SHA for 19a06ea - Browse repository at this point
Copy the full SHA 19a06eaView commit details -
suggest: Open database connections lazily.
Before, creating a provider would block the calling thread until the database was set up. Now, migrations will run the first time the database is accessed, which we already expect to happen on a background thread.
Configuration menu - View commit details
-
Copy full SHA for 643cae3 - Browse repository at this point
Copy the full SHA 643cae3View commit details -
suggest: Build config changes for Kotlin UniFFI bindings.
This commit adds an empty UniFFI interface for the new Suggest component.
Configuration menu - View commit details
-
Copy full SHA for a564ef3 - Browse repository at this point
Copy the full SHA a564ef3View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5b65098 - Browse repository at this point
Copy the full SHA 5b65098View commit details -
Configuration menu - View commit details
-
Copy full SHA for e9dfbe4 - Browse repository at this point
Copy the full SHA e9dfbe4View commit details -
Configuration menu - View commit details
-
Copy full SHA for a57579a - Browse repository at this point
Copy the full SHA a57579aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 591b789 - Browse repository at this point
Copy the full SHA 591b789View commit details -
Configuration menu - View commit details
-
Copy full SHA for 32fe892 - Browse repository at this point
Copy the full SHA 32fe892View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7faef03 - Browse repository at this point
Copy the full SHA 7faef03View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5506349 - Browse repository at this point
Copy the full SHA 5506349View commit details -
suggest: Rename
SuggestionProvider
toSuggestStore
.In other uses, "provider" refers to the source of a suggestion, like adM, Wikipedia, AMO, etc. Since `SuggestionProvider` aggregates suggestions from all these sources, calling it a "provider" could be confusing, especially if we support filtering suggestions from specific sources in the future.
Configuration menu - View commit details
-
Copy full SHA for f406f10 - Browse repository at this point
Copy the full SHA f406f10View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5badadc - Browse repository at this point
Copy the full SHA 5badadcView commit details -
suggest: Replace the
SuggestionQuery
builder with a dictionary.The Gecko JS UniFFI bindings don't support synchronous function calls yet (https://bugzilla.mozilla.org/show_bug.cgi?id=1842433), so the builder API will be a little awkward to use on Desktop. This commit replaces the builder with a dictionary, with default fields to make it more ergonomic.
Configuration menu - View commit details
-
Copy full SHA for 061a9ac - Browse repository at this point
Copy the full SHA 061a9acView commit details -
Configuration menu - View commit details
-
Copy full SHA for 11352c1 - Browse repository at this point
Copy the full SHA 11352c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for d816056 - Browse repository at this point
Copy the full SHA d816056View commit details -
suggest: Refactor
full_keyword
.This commit adds documentation and tests for `full_keyword`, and reimplements it using the Rust iterator methods.
Configuration menu - View commit details
-
Copy full SHA for d964697 - Browse repository at this point
Copy the full SHA d964697View commit details -
suggest: Support clearing the suggestions store.
This commit exposes `SuggestDb.clear()` as `SuggestStore.clear()`, and ensures that it removes all icons in addition to suggestions and metadata.
Configuration menu - View commit details
-
Copy full SHA for 43248d6 - Browse repository at this point
Copy the full SHA 43248d6View commit details -
suggest: Clarify internal vs. public interfaces.
This commit changes the visibility of crate-internal types and methods from `pub` to `pub(crate)`, and clarifies the difference between the two error types: * `SuggestApiError` is the public error type, for all errors that should be handled by the application. * `Error` is the internal error type, used in the implementation of the component, and is not part of the public interface.
Configuration menu - View commit details
-
Copy full SHA for f99aca0 - Browse repository at this point
Copy the full SHA f99aca0View commit details -
Configuration menu - View commit details
-
Copy full SHA for cdc3971 - Browse repository at this point
Copy the full SHA cdc3971View commit details -
Configuration menu - View commit details
-
Copy full SHA for c4a4a96 - Browse repository at this point
Copy the full SHA c4a4a96View commit details -
Configuration menu - View commit details
-
Copy full SHA for 54d8a08 - Browse repository at this point
Copy the full SHA 54d8a08View commit details -
suggest: Refactor database transaction management.
This commit makes it possible to combine multiple database accesses into a single transaction. Previously, each `SuggestDb` method would lock the database connection, and optionally run its own transaction before releasing the lock. This meant that a single logical operation, like ingesting all suggestions from an attachment, would involve multiple transactions. This commit moves the database accesses into a new `SuggestDao` type, which takes a reference to an existing locked connection. The new `SuggestDb::{read, write}` methods handle locking and transaction management, and take a closure that receives a `SuggestDao` for reading and writing. Co-authored-by: Tif Tran <ttran@mozilla.com>
Configuration menu - View commit details
-
Copy full SHA for b25c815 - Browse repository at this point
Copy the full SHA b25c815View commit details -
Configuration menu - View commit details
-
Copy full SHA for b372e9f - Browse repository at this point
Copy the full SHA b372e9fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 959ac2c - Browse repository at this point
Copy the full SHA 959ac2cView commit details -
suggest: Open SQLite connections with
SQLITE_OPEN_NO_MUTEX
.`SuggestDb` already protects the connection with a Rust mutex, so SQLite's per-connection mutex is unnecessary.
Configuration menu - View commit details
-
Copy full SHA for 548e941 - Browse repository at this point
Copy the full SHA 548e941View commit details -
suggest: Rename
IngestLimits
toSuggestIngestionConstraints
.This commit also generalizes `IngestLimits.records` to `SuggestIngestionConstraints.max_suggestions`, since the partitioning scheme and number of suggestions per Remote Settings attachment is an implementation detail.
Configuration menu - View commit details
-
Copy full SHA for 46bdeba - Browse repository at this point
Copy the full SHA 46bdebaView commit details -
suggest: Clarify "fetching" in docs and type names.
"Fetching" is a bit of an overloaded term that can refer to querying ingested suggestions, or downloading records from Remote Settings. To reduce confusion, let's replace those uses with more precise terminology: * "Downloading" for when we request suggestions from Remote Settings. * "Ingesting" for storing the downloaded suggestions in the database. * "Querying" for when the application requests ingested suggestions.
Configuration menu - View commit details
-
Copy full SHA for 690a143 - Browse repository at this point
Copy the full SHA 690a143View commit details -
suggest: Don't pass
SuggestionQuery
[ByRef].This matches how we pass dictionaries across the FFI boundary in our other components.
Configuration menu - View commit details
-
Copy full SHA for 1e7bd53 - Browse repository at this point
Copy the full SHA 1e7bd53View commit details -
suggest: Include the collection name in the "last ingest" metadata key.
A bit of future-proofing, in case we support multiple Remote Settings collections in the future.
Configuration menu - View commit details
-
Copy full SHA for a427eb2 - Browse repository at this point
Copy the full SHA a427eb2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 3c52626 - Browse repository at this point
Copy the full SHA 3c52626View commit details -
suggest: Clarify type names for downloaded suggestions.
This commit renames: * `RemoteSuggestion` to `DownloadedSuggestion` and `SuggestDataAttachmentContents` to `DownloadedSuggestDataAttachment`, for consistency with the "downloading" terminology. * `RemoteRecordId` to `SuggestRecordId`, for consistency with the other Remote Settings types.
Configuration menu - View commit details
-
Copy full SHA for a95dcb5 - Browse repository at this point
Copy the full SHA a95dcb5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 44e61d3 - Browse repository at this point
Copy the full SHA 44e61d3View commit details -
Configuration menu - View commit details
-
Copy full SHA for c43a481 - Browse repository at this point
Copy the full SHA c43a481View commit details