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.
- 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`.
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.
The `SqlInterruptHandle` and `SqlInterruptScope` types and especially
the shutdown code feels like belongs in `interrupt-support` better than
`sql-support`.
Removed the `implement_into_ffi_by_pointer!(SqlInterruptHandle)` call.
I don't think we need that now that everything is UniFFIed.
* upgrades rust to 1.57
* fixes clippy
* Document where to find the latest version moz-central uses
* an attempt to fix broken cargo bench
* Uses _ instead of dead_code where possible
* runs cargo update