Граф коммитов

26 Коммитов

Автор SHA1 Сообщение Дата
Mark Hammond 47ef7c8c98 Update some crates to avoid cargo audit errors
As part of this, update clap for app-services examples.
2024-03-06 16:02:17 +00:00
Mark Hammond f538529f15 Update a number of crate package versions.
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.
2024-02-06 15:43:45 +00:00
Mark Hammond 0c2109c89d Move rusqlite/libslite3-sys to workspace dependencies 2023-12-13 15:53:26 +00:00
Sammy Khamis 8a23472daa Refactor VisitTransition to be VisitType 2023-10-16 21:13:39 +00:00
Tarik Eshaq ffb06acd44 Updates rusqlite to 0.29.0 and libsqlite to 0.26.0 2023-06-13 01:11:26 +00:00
Ben Dean-Kawamura b3a573164e Clippy and check-dependency fixes 2023-01-27 15:32:17 -05:00
Mark Hammond 24098bcafd
Update rust version to 1.65.0, MSR to 1.61 (#5299) 2022-12-16 14:02:22 +11:00
Mark Hammond ba67a665dd
Update rusqlite to 0.28.0 (#5282) 2022-12-08 15:01:25 +11:00
Ben Dean-Kawamura 8f9d0d365c Make places metrics more fine-grained (#5246)
Added `execute_one()` method to `ConnExt`.  I've wanted this a few times
before, but it's really nice for this new code.
2022-11-17 18:28:53 -05:00
Tarik Eshaq 0648c69d7b
Removes db files added by accident (#5211) 2022-11-02 14:33:13 -06:00
Ben Dean-Kawamura 01aeb370c3 Further reworked the places errors
- 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`.
2022-10-27 18:37:45 -04:00
Ben Dean-Kawamura 1c4093bb3d Refactored places to use the new error handling system
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`.
2022-10-20 09:05:59 -04:00
Ben Dean-Kawamura 46c31af855 Adding history pruning (#5011)
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.
2022-07-28 17:49:25 -04:00
Tarik Eshaq f7c5588b1e
Update rand and parking lot (#4937)
* 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>
2022-05-02 17:18:12 -07:00
Thom Chiovoloni f8f3589be3
Update everything to non-depreceated rusqlite functions 2022-03-06 20:27:49 -08:00
Thom Chiovoloni 4d3f7db7fc
Bump versions of `rusqlite`/`libsqlite3-sys` in `Cargo.toml`s 2022-03-06 20:27:06 -08:00
Ben Dean-Kawamura f504aa09ae Refactoring the interrupt code
- 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.
2022-02-16 10:57:10 -05:00
Ben Dean-Kawamura db23ab40f6 Moving modules from sql-support to interrupt-support
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.
2022-02-16 10:57:10 -05:00
Tarik Eshaq 68c10e0673
upgrades to rust 2021 [ci full] (#4822)
* upgrades to rust 2021

* Push rust minimum version to 1.57
2022-02-07 09:38:05 -08:00
Tarik Eshaq 36ae51e12e
Upgrade rust to 1.57 (#4723)
* 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
2021-12-20 10:48:14 -07:00
Sammy Khamis 41575c3502
Update rust according to moz-central updates [ci full] (#4486)
* update rust to 1.55 according to moz-central updates
2021-09-22 15:24:00 -10:00
Mark Hammond ff6156416b
We rely on url version 2.2 and just got lucky that we had it (#4489) 2021-09-22 07:56:29 +10:00
dependabot-preview[bot] 5220605d08 Bump rusqlite from 0.24.1 to 0.24.2
Bumps [rusqlite](https://github.com/rusqlite/rusqlite) from 0.24.1 to 0.24.2.
- [Release notes](https://github.com/rusqlite/rusqlite/releases)
- [Changelog](https://github.com/rusqlite/rusqlite/blob/master/Changelog.md)
- [Commits](https://github.com/rusqlite/rusqlite/compare/v0.24.1...v0.24.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-11 10:14:54 +11:00
Mark Hammond adb8907e00
Update rusqlite to 0.24.1 and libsqlite3-sys to 0.20.1 (#3633) 2020-10-08 14:27:52 +11:00
lougeniac64 f14634bcc9 Removed duplicate timestamp code from places component 2020-09-21 15:00:30 -04:00
Thom Chiovoloni 821c163ba3 Optimize project layout to avoid bad build performance 2020-07-20 09:56:36 -07:00