Some checks failed
doc-engine / engine (push) Waiting to run
doc-engine / consumer (push) Waiting to run
nigig-map / test (push) Waiting to run
sms / gates (push) Waiting to run
sms / robius-sms (push) Waiting to run
sms / android (push) Waiting to run
sms / nigig-sms (push) Waiting to run
sms / supply-chain (push) Waiting to run
nigig-build (CAD) / supply-chain (push) Has been cancelled
nigig-build (CAD) / cad-module (push) Has been cancelled
nigig-build (CAD) / full-crate-check (push) Has been cancelled
repo hygiene / hygiene (push) Has been cancelled
50 tests -> 102, and the two that were there at the start of this work
are deleted.
Where this started: robius-sms had ZERO tests, and nigig-sms had two --
bulk_sub_tab_default_is_contacts and bulk_sub_tab_variants_distinct.
Both asserted a derived Default and a derived PartialEq. Neither
mentioned SMS. Neither could fail short of the compiler breaking. That
is the defect that produced every other defect in this plan: nothing
could prove a change was safe, so nothing was ever deleted and every
bug survived contact with review.
Property tests (proptest, new dev-dependency)
Seven over truncate_preview, format_timestamp, badge_text, and five
more over segment_count, the rate limiter and ScheduleRequest.
These are the ones that matter, because the hand-written cases in this
repo all encode a bug someone had ALREADY found. proptest searches the
space instead. I verified that by reinstating the original byte-slicing
truncate_preview and confirming
prop_truncate_preview_survives_mixed_scripts and
prop_truncate_preview_respects_the_char_limit both fail against it --
they would have caught A3 before it shipped.
prop_rate_limiter_respects_capacity models the window independently
and asserts the invariant across random clock sequences, rather than
re-implementing the limiter's own arithmetic in the assertion.
Integration tests (2 new files, public API only)
robius-sms/tests/sms_pipeline.rs and nigig-core/tests/sms_store.rs go
through the public surface the application actually uses. The unit
tests inside src/ can see private helpers; these cannot, which is the
point -- they catch a refactor that keeps every unit test green while
breaking the caller-visible contract.
Two of them are privacy canaries. e1_message_bodies_are_never_persisted
and e1_no_body_text_reaches_the_serialised_store fail if anyone removes
#[serde(skip)] from OfflineSmsMessage.body. Verified by removing it:
both fail, the other six pass. Nothing else in the tree would have
noticed the inbox silently going back to plaintext on disk.
Named regression tests
One per defect, named for it -- c1_*, d1_*, d3_*, e1_*, e7_*, a4_*,
c3_*, c7_* -- so a future reader goes from a failing test straight to
the bug it guards rather than to a git archaeology session.
New coverage for logic that had none
- build_timeline_items / build_filtered_timeline_items: date-divider
placement and the message indices the draw loop uses to index
conv_data.messages. An off-by-one there renders the wrong body in
the wrong bubble; it had no test at all.
- kind_to_offline / kind_from_offline round-trip: the only thing
stopping a cached Sent message reappearing as Inbox after a restart,
which would flip the bubble to the wrong side of the screen.
- normalize_number: what C1 groups on, across five formatting variants
plus short codes and alphanumeric senders.
MessageKind::from_android_type / to_android_type were hoisted out of
sys/android/inbox.rs onto the type, the same way ScheduleRequest::validate
was in A4, so the provider mapping is testable off-device. An
unrecognised TYPE value is preserved verbatim in Unknown rather than
defaulted, and there is a property test asserting the round trip is
total over every i32.
CI: a test-count FLOOR at 100. A floor rather than a ratchet -- unlike
the clippy count, there is no reason to ever want this number to fall.
Deliberately NOT faked: the JNI cursor loop, the keystore round-trip and
broadcast delivery still need an emulator. A mock returning what I expect
would test my expectations, not Android. Those remain called out in the
Phase A and E commit messages.
Verified: 11/11 checks. 48 robius-sms + 46 nigig-sms + 8 sms_store = 102.
clippy -D warnings clean on host and aarch64-linux-android; nigig-sms
ratchet holds at 32 (my first draft added an orphaned `use super::*`,
caught by the ratchet and removed rather than baselined).
56 lines
1.9 KiB
TOML
56 lines
1.9 KiB
TOML
[package]
|
|
name = "robius-sms"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
build = "src/build.rs"
|
|
|
|
authors = [
|
|
"Kevin Boos <kevinaboos@gmail.com>",
|
|
"Project Robius Maintainers",
|
|
]
|
|
description = "Rust abstractions for multi-platform native SMS access, sending, and Android scheduling."
|
|
documentation = "https://docs.rs/robius-sms"
|
|
keywords = ["robius", "sms", "message", "text", "android"]
|
|
# E10: the manifest carried no licence field, so cargo-deny needed a
|
|
# [[licenses.clarify]] override asserting this. State it here instead.
|
|
license = "MIT OR Apache-2.0"
|
|
readme = "README.md"
|
|
|
|
[features]
|
|
trollstore = ["dep:rusqlite"]
|
|
|
|
[build-dependencies]
|
|
android-build = "0.1.2"
|
|
|
|
[dependencies]
|
|
cfg-if = "1.0.0"
|
|
rusqlite = { version = "0.32", default-features = false, optional = true }
|
|
|
|
[target.'cfg(target_os = "android")'.dependencies]
|
|
jni = { version = "0.21.1", default-features = false }
|
|
robius-android-env = "0.2.0"
|
|
|
|
[target.'cfg(target_os = "windows")'.dependencies]
|
|
windows-core = { version = "0.56.0", default-features = false }
|
|
windows = { version = "0.56.0", default-features = false }
|
|
|
|
[target.'cfg(target_vendor = "apple")'.dependencies]
|
|
block2 = "0.6.1"
|
|
dispatch2 = { version = "0.3.0", default-features = false, features = ["std"] }
|
|
objc2 = "0.6.1"
|
|
objc2-foundation = { version = "0.3.1", default-features = false, features = ["std", "NSString"] }
|
|
|
|
# E9: no Linux-specific dependencies.
|
|
#
|
|
# This target used to pull polkit =0.17.0 and gio =0.17.0. sys/linux.rs
|
|
# references neither: every one of its twelve functions returns
|
|
# Err(PermanentlyUnavailable). Those two crates -- pinned to 2023
|
|
# versions -- dragged in glib and proc-macro-error and were the sole
|
|
# source of RUSTSEC-2024-0370 and RUSTSEC-2024-0429 for every consumer
|
|
# of this crate, plus an LGPL-2.1 question about linking polkit into a
|
|
# distributed binary.
|
|
#
|
|
# Deleting them costs nothing: the stub compiles and behaves identically.
|
|
|
|
[dev-dependencies]
|
|
proptest = "1"
|