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).
Made the wrapper code work with the new FxaConfig and FxaServer classes.
As noted, we should probably just expose those classes directly to the
consumer application, since they're almost identical to the
server/config classes that we do expose. However, let's wait just a bit
and fix a couple smaller breaking changes at once.
* 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.
When doing #5139 I tried to have a test-utils feature for sync15,
which didn't really work out for various reasons but it was left in.
Currently `cargo test -p sync15 --features=sync-client` fails, although
CI doesn't every run that (it runs with default and all features)
This PR kills that feature entirely.
Reworks how BSOs work in all syncable components.
This adopts some of the BridgedEngine model - specifically, there's now
an IncomingBso and OutgoingBso, each with a corresponding IncomingEnvelope
and OutgoingEnvelope. There's also a new formalized "content" mechanism
for serializing and deserializing payloads to and from some T, with a
sane and consistent procedure for handling tomebstones and malformed
records.
BridgedEngine and SyncEngine now work using these new types, getting us
closer to fully integrating these engines into a single trait.
This kills sync15::Payload entirely in favor of the new system.
- Renamed `PlacesInternalError` to `Error` because it seems more
idiomatic
- Renamed `PlacesError` to `PlacesApiError` to make it consistent with
the logins errors. I considered just calling this `ApiError` but I
thought that would be confusing for consumers since they won't always
have the `places::` prefix before the class name.
- Removed `JsonError`, which seems like it was unusped
- Merged `InternalError` into `UnexpectedPlacesException`
- Merged `UrlTooLong` into `UrlParseFailed` for `PlacesApiError`
- Merged `InvalidBookmarkUpdate`, `CannotUpdateRoot`, `InvalidParent`
into `InvalidBookmarkOperation` for `PlacesApiError`
Use the fielded style for `PlacesApiError` in places.udl. Updated
`PlacesApiError` to use named fields to be compatible with this.
On swift renamed `PlacesApiError`, which was defined on top of the
normal errors to `PlacesConnectionError`.
Replaced the error_support method with the new system that consists of:
- `PlacesInternalError`: used internally in the crate. This replaces
the old `ErrorKind` enum and is the error for `Result<>`.
- `PlacesError`: used for external errors that we return to UniFFI
consumers. This replaces the old `Error` enum and is the error for
`ApiResult<>`
- A `GetErrorHandling` impl to convert internal errors to external
errors and report to sentry. For now, I tried to make the sentry
error reporting more-or-less match the old error reporting, which
means reporting lots of internal errors. The plan is going to be to
check sentry and most likely turn some of those into logs rather
than errors.
Reworked all top-level API methods to return `PlacesApiResults` and use
the `handle_error!` macro to do the error conversion/reporting.
Use `thiserror` to handle converting errors from other crates into
`PlacesInternalError`.
* Fixes missing titles
* Adds test for title recovery
* Uses a different transaction for running the frecency update
* Fix clippy
* Uses proper transactions
* Adds ios history migration and example
* Exposes history migration function to iOS
* Adds changelog
* Adds basic test case for migration
* Moves timestamp computation to places
* Adds sync last timestamp
sync-test was removed from the workspace some time ago, which meant it
was never built or checked, so it went quite stale, particularly with
respect to logins changes.
We not keep it in the workspace but as an "excluded" item, which means
you can run it from its directory. To prevent it going stale again, CI
runs clippy on it.
Also needed a few misc tweaks to some other crates.
If the new feature is enabled, tabs can sync - otherwise it can not.
The intention is that later there will be a "bridged-sync" feature,
and that in-practice, one or the other will be enabled - however, the
way features work, it must be possible that no features are enabled.
The new feature is not a default feature because I expect we will
want the default features to be what desktop consumes - ie, that
the default feature will be bridged-sync once that exists.
This isn't strictly required yet, but is being done now to make
future reviews of the bridged engine easier to reason about.
Added parameter to `run_maintanance()` to allow applications to request a maximum DB size and
prune the database if it's bigger than that.
Added code to find the best visits to prune and delete them.
* Update rand and parking_lot.
I need this to update other Gecko dependencies.
* Update dependency_summary to account for various windows-rs crates.
I'm not sure why it wasn't failing to find the relevant licenses before,
it was likely a pre-existing issue.
* Update dependency summaries.
* Runs dependency summaries on a mac
Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io>
- Refactored the `SqlInterruptHandle` and `SqlInterruptScope` types to
work better with the new code.
- Types now store an `SqlInterruptHandle` and use that to create
`SqlInterruptScope` instances. This seems more natural than storing
an `Arc<AtomicUsize>` and using that to create both the scope and
handle.
- Creating an `SqlInterruptScope` can fail if we are in shutdown mode.
Updated the calling code to handle this error.
- We now use `Ordering::Relaxed`. This has less overhead compared to
`Ordering::SeqCst` and I'm pretty sure we don't need the extra
synchronization guarantees
- Moved the `Interrupted` and `Interuptee` types to their own modules.
Updated the shutdown module documentation.
- Changed the `PlacesApi` sync methods to to just send `NeverInterrupts`
to the `sync_multiple()`. I think this is fine given that we only use
these methods on iOS and we don't have actual interruption support
there yet.
- Removed the `PlacesApi::new_sync_conn_interrupt_handle()` method. If we want
to interrupt syncing, then we should just enter shutdown mode.
* initial conversion of errors for places uniffication
* Converted history metadata functions for places uniffication
* Converted kotlin history metadata functions
* Converted iOS history metadata functions
* [Places uniffication] Fix places error issues (#4687)
* remove uniffi-specific wrapper and updated error test
* Uniffi VisitObservation and apply_observation (#4689)
* uniffied VisitObservation, HistoryVisitInfo and methods using those structs
* Uniffi top frecent site info (#4711)
* Uniffi top frecent site info
* Uniffis FrecencyThresholdOption
* Uniffi Places Sync (#4714)
* uniffi places sync and sync15 functions
* Uniffi Search result and match url (#4720)
* Uniffi query autocomplete
* uniffi places_accept_result
* uniffi places_match_url
* cargo fmt
* cargo clippy
* remove accept_result from ffi crate
* Adds comment on the uniffi bug with varaint shadowing type
* Uniffi Places Interrupt methods (#4726)
* uniffi places interrupt functions
* Consolidate types (#4736)
* Updates the visit observation to use URL
* Uses VisitTransition for HistoryVisitInfo
* updates uniffi to 0.16
* Uniffied bookmarks
* switch to use uint in the apis for adding bookmarks (#4747)
* Remove the manual places FFI entirely.
* folders and separators now have non-nullable parents
* Always insert via Insertable items, and clarify separation between node types.
* Add json_tree module with all json-based types and implementation.
* Fix swift warnings re non-null parentGuid
* bookmarks: Remove public_node and introduce a fetch module
* Update swift code to make breaking changes fixes cleaner (#4766)
* rebased and added changelog entry
Co-authored-by: lougeniac64 <lougeniaC64@users.noreply.github.com>
Co-authored-by: Tarik Eshaq <teshaq@mozilla.com>
Co-authored-by: Mark Hammond <mhammond@skippinet.com.au>