This creates a basic search component stub with a simple function that does nothing except raise an error.
Full functionality will come in later commits
The tabs and clients engines use the same logic to truncate a list of
items to fit within a size limit when serialized to JSON, though
they handle failures differently: the tabs engine sends the complete
list of tabs; the clients engine clears the list of commands.
We'll reuse the same core logic to pack URLs for closed synced tabs
into multiple commands, so let's factor it out into a shared
support crate.
Added boilerplate for UniFFI, error handling, databases, etc. I tried
to follow the best practices from other application-services components.
Created the initial types and methods for the API. I think all of these
should be considered works-in-progress. It seems likely that some or
all of them will change as we implement the functionality.
Added some code to read / write URL interest data from a test binary
file currently stored in the repo. This is also a WIP, at the very
least it needs to change to download the data from remote settings.
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.
Using the ohttp-rs and bhttp-rs Rust libraries to perform underlying encoding
and encryption. This is exposed to Swift using URLRequest/Response types that
are typical for the platform.
Note that only iOS is targetted since Gecko projects have a builtin OHTTP
solution within Necko.
This use currently using the Rust Crypto libraries for underlying HPKE support,
but this should be changed to NSS or OpenSSL in future.
Added a new crate called `rust-log-forwarder` that forwards logs to
consumers. This does basically the same thing as `rc-log`, but it uses
UniFFI. Once our consumer apps swich over to `rust-log-forwarder`, we
can remove the `rc-log` component.
- Switched to using workspace dependencies, this will make future
updates much simpler
- Updated code to work with the new UniFFI crate structure
- Updated the error-support integration tests to work with the workspace
dependencies, following this advice: https://stackoverflow.com/a/71461114.
* [demo] handle_error as a proc macro
* Adds more tests
* Rework handle_error proc macro to take no arguments
* ignore rustdoc since it doesn't have expore to error_support
* Removes function signature validation
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.
* 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>
- Replaced hand-written FFI code with UniFFI code
- Updated error handling to just use thiserror. There's no need for
error-support anymore.
- Added an enum for the SyncParams.engine. This seems cleaner than
having None mean sync all engines.
- Replaced `SyncResult.results` with `SyncResult.successful` and
`SyncSyncResult.failures`. Before this was handled in the Kotlin
wrapaper code.
- Made the megazord depend on tabs directly. Before it pulled in tabs
because of a transitive dependency from sync_manager_ffi.
This is a definitely-for-development-purposes-only component that exposes
some functions to let you deliberately crash your application in interesting
Rust-code-related ways.
The idea is that application developers could add some developer-only UI that
deliberately triggers one of these functions, and then try out the crash or
error-handling behaviour of their app in a live setting. We hope to be able
to use this to debug symbolication issues on Firefox for iOS, ref #3907.
As a side benefit, the very process of adding this component has let me write
a couple of nice tests that our generated bindings are working as intend around
the edges of error and panic handling.
This is a substantial refactor of the fxa-client crate, intended to bring it
up to speed with our latest best-practices around developing cross-platform
Rust components, in order to ease ongoing maintenance.
THe core change here is that I've deleted the hand-written Kotlin and Swift
bindings, replacing them with autogenerated bindings thanks to UniFFI.
There is still a little bit of hand-written Kotlin, since we have a layer that
automatically manages persistence via a callback. There is still a nontrivial
amount of hand-written Swift, since we have a higher-level state machine built
atop the lower-level fxa-client functionality (such state-machine also exists
for Kotlin, but lives in the android-components repo). If UniFFI works out then
we should look into moving more of that logic into shared Rust code over time.
To support the introduction of UniFFI, I have restructured to Rust crate so
that its public interface deliberately parallels the interface offered to
Kotlin and Swift, and have moved the implementation details into a submodule
named `internal`. It's my opinionated belief that structuring the crate this
way will help us focus on producing a nice consumer API, which is not always
the same thing as producing a nice Rust crate.
On top of that, I've also revamped the documentation in the crate, leaning
in to the use of `cargo doc` as the source of truth for both developer-
and consumer-facing documentation. Let's consider that an experiment and
see how we like it in practice.
Unfortunately, this is a big PR, but I don't think I could have made it
too much smaller. Hopefully it will be easier to review than its size
suggests since it's mostly additions and deletions rather than complex
changes.
This is an attempt to simplify how we use `uniffi-bindgen`, by making
it easy to run the version used by the workspace rather than assuming
that the user has a correctly-matching version of it installed in their
system cargo.
The lockwise apps are on a very old version of appservices and I don't believe
we have a plan for updating them anytime soon. Continuing to build the lockbox
megazord does not seem like a good use of CI or local dev resources.
We understand how to bring this back if we need it, but also, if we do need
it again in future it's probably a good opportunity to revisit how we build
custom megazords in the first place.
This commit pulls in https://github.com/mozilla/nimbus-sdk as a
git submodule, and adds some build integration to publish it as
part of the application-services megazord. Instead of an all-in-one
nimbus package, we produce two separate packages:
* `org.mozilla.appservices:nimbus` with the Nimbus Kotlin code
* `org.mozilla.appservices:full-megazord` updated to include the
Nimbus Rust code.
Nimbus SDK and its dependencies are not currently compatible with
Rust v1.43.0, but application-services is pinned to that version
of rust for compatibility with mozilla-central.
This reverts commit 8388372259.