This adds a new utility type ObservableEvent, which synchronously runs
any registered callbacks when the event fires. CustomDnsResolver can
then subscribes to a "network changed" event on creation, clearing its
cache. At the other end of the stack, the ConnectionManager contains
the event, to eventually be exposed to the app languages as part of
the Net abstraction.
Additional parts of libsignal-net will subscribe to the "network
changed" event in the future. In particular, it should reset
persistent connection cooldowns.
Previously the Android libraries were stripped as part of the build,
but what we're really trying to track is the download size and
size-on-disk for Android users, so the stripped library is more
relevant (and lets us continue to compare against previous releases).
This *greatly* increases the size of the artifacts uploaded to Maven,
but it looks like the libraries do correctly get stripped when the
final APK is built. (This was not true in the past.)
Also, make sure the built library includes a "build ID", or else the
stripped version of the library will be treated as a different
library, and all the line tables will go to waste.
Add a type with a canonical serialized form that, for the same logical backup
contents (even with frame reorderings), will always serialize to the same value.
This can happen if we get into an error state, or if we have a bug
that has the connection attempt early-exit. We don't want to spin in
place trying to connect.
Use a similar strategy as for Node, but with an additional crate that serves as
the target for running cbindgen. The expectation is that since iOS links with
the native signal_ffi statically, the linker will be able to prune out the
unsued test-only code.
This replaces the recipient ID, which is a weak logical reference to external
data, with one of two types, depending on the mode. For streaming validation,
only the minimal data is kept. For validation via the CLI or (soon) for
canonicalization, the full data is kept behind an Arc.
Unlike Java, just bundle it into the exiting signal_node shared library. We
don't care as much about code size here and splitting it into a separate
library is significantly more complicated (though it might be worth it some
day).
- For local development, this built the Rust library automatically
when you invoked `yarn install`, whether you wanted it to or not.
- For the published package, this either did nothing (if the correct
prebuilds were present) or produced a weird error (if they weren't).
You can't use the published package without prebuilds, so maybe this
was useful, but you'd find that out pretty quickly when loading the
module failed.
- If you used the "link" feature to build Signal Desktop with a local
checkout of libsignal, this would build the Rust library
automatically when you `install`ed in the *Desktop* directory,
whether you wanted it to or not.
- If you pointed Signal Desktop at a local checkout by copy instead of
link, this would just fail, because the Rust parts wouldn't be
copied with it.
Overall, it's simpler to just have this step be explicit.
The main benefit of this is not our *own* type-checking; it's that
mypy will error out if you try to use a too-new Python API. And in
fact, we were already relying on Python 3.9 and didn't realize.
check_code_size.py works with JSON, so it still uses Any a fair bit.
This parallels the exiting libsignal-jni crate but exports functions from
libsignal-bridge-testing instead of libsignal-bridge. The crate is compiled as
a separate shared object that is included in the published libsignal package,
but which can be excluded at Android packaging time.
Remove the special handling code that detects EOF now that the upstream crate
has fixed the bug that was being worked around. This also fixes a bug where EOF
was being incorrectly detected when the provided buffer was empty. Add a test
case to prevent regression in the future.