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.
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
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>
* Rename 'engine' and 'store' to conform with the sync15 readme.
In many cases, this was literally changing 'engine' to 'store' and
'store' to 'engine', but now we have mostly consistent naming
throughout the repo, and consistency with desktop.
The sync trait is now called `SyncEngine` just to drive home the
fact that 'engine' relates to syncing.
This was largely a mechanical change. No changes were made to
the FFI functions, so this is not a breaking change.