Adding two commands to the cargo remote-settings CLI, `dump-sync` and `dump-get`. This allows
to download a local dump of a set of collections, and keep it up to date with the remote version.
It's also possible to open a PR right away to update this file in the app-services repo.
`cargo remote-settings dump-sync --create-pr` will create a local branch and push it to the repo.
When trying to `get_records` from the component, it first checks if the database has some,
if not, it checks if the collection exists and takes it from the local file.
Implemented the high-level API and the client functionality. Storage is
a big TODO.
Added a CLI to test it, you can run it using `cargo remote-settings`.
Defined metrics for suggest. I used labeled timing distributions, which
is a relatively new metric that seems great for our needs. Using these
metrics, we can track a separate timing distribution for each record
type / provider.
Updated `ingest` to return metrics. Added `query_with_metrics`, which
returns metrics alongside the usual results. Added some classes to
record metrics as the operations execute.
Moved the top-level `fetch_suggestions` from db.rs to store.rs. It's
now responsible for metrics, so I thought it fit better in store.
This is prep-work for
https://bugzilla.mozilla.org/show_bug.cgi?id=1908802.
Update the Suggest CLI to log ingestion details so that I can test that
the new code works correctly. Added support for re-ingesting
suggestions and ingesting specific providers.
Map suggestion providers to a single record type, rather than multiple
ones and always ingest icons/global config. I think this system is
simpler and also having to list icons/global config for each provider
type is a footgun. For example, we should ingest icons/config for
fakespot, but I forgot to list them.
Removed the `SuggestIngestionConstraints::max_suggestions` field. AFAICT,
it was not being used by any consumers and doesn't seem to be
implemented correctly. We apply the limit to each record type, but a
single ingestion request will have many record types. It also doesn't
seem clear to me how this should work, for example should the
config/icons count? I want to update this code, but I don't want to
worry about this field.
Updated the benchmark code to download all records/attachments directly,
rather than the complex system of running an ingestion to figure out
what to download. I'm planning on updating the client code and this
will work with the new system better.
Fetch the icons using a separate query than manually joined them with
the suggestion data. This has the advantage of not needing to update
the schema.
Also updated the suggest CLI a bit so that I could use it to test that
the code was working in practice.
The plan is to use the current code for the experiment, so we don't need
a feature flag anymore. The main point of the flag was to avoid
creating multiple migrations as the schema changed, but it looks like
the schema will be stable for a while.
Added the `suggest-cli` crate that implements a simple clap CLI to
ingest and query suggestions. This can be run using `cargo suggest`.
My plan is to use this to test fakespot blocklist support.
This can be run with `cargo relevancy`.
It currently supports classifying your history and printing the results.
The main way we get history is from sync. You can also point it to a
places DB, but this must be from a mobile FF, we can't read from
desktop.
Added flags to:
- Request the session scope.
- Control how log messages get printed to the console.
Updated the code to re-authenticated using the existing data rather than
throwing it away and starting from scratch.
These changes make it possible to repro
https://bugzilla.mozilla.org/show_bug.cgi?id=1887071
- run `cargo run -- --log -d devices` with fresh credentials.
- Any command should do, but I used `devices`
- The client should ask you to login and paste your credentials
- You should see the device list printed out
- In a browser session, change your FxA password
- run `cargo run -- --log -d devices` again
- The client should tell you there was an auth-problem and ask you to
reauthenticate.
- After you paste the reauthentication URL you should see an error
printed out
This was largely done manually to try and bring app-services and
mozilla-central closer together. With this patch we can vendor
into mozilla-central, including when most of our mobile crates are
built into libxul in the Android monorepo, oak.
This patch also re-forks find-places-db to avoid using a now orhpaned
crate which no mozilla staff had access to update.
This adds an `inactive` field to a `RemoteTabRecord` with the default
value being `false`. The intent is for the mobile platforms to start
populating this, then all platforms can choose how to handle such
tabs (eg, they may not show them by default and instead add a button
which shows them).
* create-fake-visits will create a (possibly large) number of visits.
* delete-history will remove all history
* show-stats will show some stats for the places DB.
This was part of my work for the auth PR, but I think it's useful
separatedly.
- Updated `fxa-client` to be a single binary.
- Added a cargo alias so it can be run with `cargo fxa [args]`.
I think this makes it easier to use and also will make it easier to
expand the functionality. It's easier to add another clap subcommand
than to add a new binary.
Made `FirefoxAccount` input a single `FxaConfig` instance for all of
it's configuration. I want to add more constructor arguments but don't
want to end up with a huge argument count.
Made the example code use the public API, not the internal module.
`FxaConfig` helps ease this transition. The motivation for this is that
I want to move FxaClent and some other fields to the public
`FirefoxAccount` instance, which means the example code needs to start
using it. This also results in some nice code cleanups.
Deleted the `fxa-client/migration` example, we're not really
using the migration code anymore.
Now that we're not exposing the `internal` module as pub, Rust is
noticing a lot of dead code. For the serde JSON structs, I kept the
dead fields and added an annotation. For the unused functions, I just
deleted them.
Created an `FxaServer` enum. This matches how the android wrapper
handles it and I don't think we need to input arbitrary URLs here.
It steals a cute function from webext-storage which can dump any
arbitrary query.
It also allows for the use of a `dbg()` sql function which can be
helpful trying to debug SQL as it is executing. The function is also
available as a no-op when the feature is not available to prevent us
accidently using it in released code.
Sadly this required updating the use of prettytable-rs as the old
version crashed on Apple silicon, which had a bit of a blow-on effect
on other dependencies.
* Consolidate the various types used for a "collection name" - now we
use `Cow` rather than the various `&'static str`, `&str` and `String`
used previously.
* This made it easier to clean up the `LocalCollState` state machine
to have the `Ready` state directly provide the `CollState` due to
a mismatch between `'static str` and `String` reprs of collections.
* No longer store the outgoing timestamp in an OutgoingChangeset - it was
never actually used and just creates unnecessary complexity.
* OutgoingChangsets now always supply the BSOs as they are created,
meaning less `mut` objects.
* Bonus fix to unbreak the `places-utils` example.