Skip to content

Native iCloud apps for Windows and Linux, built in Rust. Notes, Reminders, Calendar, Contacts, Drive and Photos, offline and in sync with your iPhone.

The trust token was in a volatile store, and Reminders lands

Yashwanth Kamireddidc6359f5f811
diff --git a/Cargo.lock b/Cargo.lock
index b6d70dc..2b216a1 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -8,6 +8,17 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa"
+[[package]]
+name = "aes"
+version = "0.8.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0"
+dependencies = [
+ "cfg-if",
+ "cipher",
+ "cpufeatures 0.2.17",
+]
+
[[package]]
name = "ahash"
version = "0.8.12"
@@ -69,6 +80,30 @@ dependencies = [
"serde_json",
]
+[[package]]
+name = "async-broadcast"
+version = "0.7.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "435a87a52755b8f27fcf321ac4f04b2802e337c8c4872923137471ec39c37532"
+dependencies = [
+ "event-listener",
+ "event-listener-strategy",
+ "futures-core",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-channel"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2"
+dependencies = [
+ "concurrent-queue",
+ "event-listener-strategy",
+ "futures-core",
+ "pin-project-lite",
+]
+
[[package]]
name = "async-compression"
version = "0.4.46"
@@ -81,6 +116,99 @@ dependencies = [
"tokio",
]
+[[package]]
+name = "async-io"
+version = "2.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc"
+dependencies = [
+ "autocfg",
+ "cfg-if",
+ "concurrent-queue",
+ "futures-io",
+ "futures-lite",
+ "parking",
+ "polling",
+ "rustix",
+ "slab",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "async-lock"
+version = "3.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311"
+dependencies = [
+ "event-listener",
+ "event-listener-strategy",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "async-process"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75"
+dependencies = [
+ "async-channel",
+ "async-io",
+ "async-lock",
+ "async-signal",
+ "async-task",
+ "blocking",
+ "cfg-if",
+ "event-listener",
+ "futures-lite",
+ "rustix",
+]
+
+[[package]]
+name = "async-recursion"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
+[[package]]
+name = "async-signal"
+version = "0.2.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "52b5aaafa020cf5053a01f2a60e8ff5dccf550f0f77ec54a4e47285ac2bab485"
+dependencies = [
+ "async-io",
+ "async-lock",
+ "atomic-waker",
+ "cfg-if",
+ "futures-core",
+ "futures-io",
+ "rustix",
+ "signal-hook-registry",
+ "slab",
+ "windows-sys 0.61.2",
+]
+
+[[package]]
+name = "async-task"
+version = "4.7.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de"
+
+[[package]]
+name = "async-trait"
+version = "0.1.89"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
[[package]]
name = "atk"
version = "0.18.2"
@@ -173,6 +301,15 @@ dependencies = [
"generic-array",
]
+[[package]]
+name = "block-padding"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93"
+dependencies = [
+ "generic-array",
+]
+
[[package]]
name = "block2"
version = "0.6.2"
@@ -182,6 +319,19 @@ dependencies = [
"objc2",
]
+[[package]]
+name = "blocking"
+version = "1.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a70e4329df6cb94385eed412ec92375c3cdd8a6e502493d1229b6414e4036dfa"
+dependencies = [
+ "async-channel",
+ "async-task",
+ "futures-io",
+ "futures-lite",
+ "piper",
+]
+
[[package]]
name = "brotli"
version = "8.0.4"
@@ -306,6 +456,15 @@ dependencies = [
"toml 0.9.12+spec-1.1.0",
]
+[[package]]
+name = "cbc"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6"
+dependencies = [
+ "cipher",
+]
+
[[package]]
name = "cc"
version = "1.4.5"
@@ -378,6 +537,16 @@ dependencies = [
"windows-link 0.2.1",
]
+[[package]]
+name = "cipher"
+version = "0.4.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad"
+dependencies = [
+ "crypto-common",
+ "inout",
+]
+
[[package]]
name = "combine"
version = "4.6.8"
@@ -405,6 +574,15 @@ version = "0.4.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6e8ccc4ea9f6acc32d102c0f6d471d11d913ad15f20c04de743374861fa1d414"
+[[package]]
+name = "concurrent-queue"
+version = "2.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973"
+dependencies = [
+ "crossbeam-utils",
+]
+
[[package]]
name = "cookie"
version = "0.18.2"
@@ -628,6 +806,24 @@ dependencies = [
"windows-sys 0.61.2",
]
+[[package]]
+name = "dbus-secret-service"
+version = "4.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "708b509edf7889e53d7efb0ffadd994cc6c2345ccb62f55cfd6b0682165e4fa6"
+dependencies = [
+ "aes",
+ "block-padding",
+ "cbc",
+ "dbus",
+ "fastrand",
+ "hkdf",
+ "num",
+ "once_cell",
+ "sha2",
+ "zeroize",
+]
+
[[package]]
name = "deadpool"
version = "0.12.3"
@@ -880,6 +1076,33 @@ version = "1.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7"
+[[package]]
+name = "endi"
+version = "1.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "66b7e2430c6dff6a955451e2cfc438f09cea1965a9d6f87f7e3b90decc014099"
+
+[[package]]
+name = "enumflags2"
+version = "0.7.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1027f7680c853e056ebcec683615fb6fbbc07dbaa13b4d5d9442b146ded4ecef"
+dependencies = [
+ "enumflags2_derive",
+ "serde",
+]
+
+[[package]]
+name = "enumflags2_derive"
+version = "0.7.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67c78a4d8fdf9953a5c9d458f9efe940fd97a0cab0941c075a813ac594733827"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
[[package]]
name = "equivalent"
version = "1.0.2"
@@ -907,6 +1130,26 @@ dependencies = [
"windows-sys 0.61.2",
]
+[[package]]
+name = "event-listener"
+version = "5.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a23add41df1562121a9393cb065eab5146a1242410f23a644851e90cfd669d2"
+dependencies = [
+ "parking",
+ "pin-project-lite",
+]
+
+[[package]]
+name = "event-listener-strategy"
+version = "0.5.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93"
+dependencies = [
+ "event-listener",
+ "pin-project-lite",
+]
+
[[package]]
name = "fallible-iterator"
version = "0.3.0"
@@ -1057,6 +1300,19 @@ version = "0.3.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53c0fa8157de1303bfffdaa1cc2a673bfffb60102f76b0ef4441659124373fed"
+[[package]]
+name = "futures-lite"
+version = "2.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad"
+dependencies = [
+ "fastrand",
+ "futures-core",
+ "futures-io",
+ "parking",
+ "pin-project-lite",
+]
+
[[package]]
name = "futures-macro"
version = "0.3.34"
@@ -1466,6 +1722,15 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
+[[package]]
+name = "hkdf"
+version = "0.12.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7"
+dependencies = [
+ "hmac",
+]
+
[[package]]
name = "hmac"
version = "0.12.1"
@@ -1767,6 +2032,16 @@ dependencies = [
"cfb",
]
+[[package]]
+name = "inout"
+version = "0.1.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01"
+dependencies = [
+ "block-padding",
+ "generic-array",
+]
+
[[package]]
name = "ipnet"
version = "2.12.2"
@@ -1950,8 +2225,9 @@ version = "3.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eebcc3aff044e5944a8fbaf69eb277d11986064cba30c468730e8b9909fb551c"
dependencies = [
- "linux-keyutils",
+ "dbus-secret-service",
"log",
+ "secret-service",
"zeroize",
]
@@ -2030,16 +2306,6 @@ dependencies = [
"vcpkg",
]
-[[package]]
-name = "linux-keyutils"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83270a18e9f90d0707c41e9f35efada77b64c0e6f3f1810e71c8368a864d5590"
-dependencies = [
- "bitflags 2.13.2",
- "libc",
-]
-
[[package]]
name = "linux-raw-sys"
version = "0.12.1"
@@ -2193,6 +2459,33 @@ version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086"
+[[package]]
+name = "nix"
+version = "0.29.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46"
+dependencies = [
+ "bitflags 2.13.2",
+ "cfg-if",
+ "cfg_aliases",
+ "libc",
+ "memoffset",
+]
+
+[[package]]
+name = "num"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23"
+dependencies = [
+ "num-bigint",
+ "num-complex",
+ "num-integer",
+ "num-iter",
+ "num-rational",
+ "num-traits",
+]
+
[[package]]
name = "num-bigint"
version = "0.4.8"
@@ -2203,6 +2496,15 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "num-complex"
+version = "0.4.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495"
+dependencies = [
+ "num-traits",
+]
+
[[package]]
name = "num-conv"
version = "0.2.2"
@@ -2218,6 +2520,27 @@ dependencies = [
"num-traits",
]
+[[package]]
+name = "num-iter"
+version = "0.1.46"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c92800bd69a1eac91786bcfe9da64a897eb72911b8dc3095decbd07429e8048b"
+dependencies = [
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-rational"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824"
+dependencies = [
+ "num-bigint",
+ "num-integer",
+ "num-traits",
+]
+
[[package]]
name = "num-traits"
version = "0.2.19"
@@ -2466,6 +2789,16 @@ version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d"
+[[package]]
+name = "ordered-stream"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9aa2b01e1d916879f73a53d01d1d6cee68adbb31d6d9177a8cfce093cced1d50"
+dependencies = [
+ "futures-core",
+ "pin-project-lite",
+]
+
[[package]]
name = "pango"
version = "0.18.3"
@@ -2491,6 +2824,12 @@ dependencies = [
"system-deps",
]
+[[package]]
+name = "parking"
+version = "2.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba"
+
[[package]]
name = "parking_lot"
version = "0.12.5"
@@ -2588,6 +2927,17 @@ version = "0.2.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd"
+[[package]]
+name = "piper"
+version = "0.2.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1"
+dependencies = [
+ "atomic-waker",
+ "fastrand",
+ "futures-io",
+]
+
[[package]]
name = "pkg-config"
version = "0.3.34"
@@ -2633,6 +2983,20 @@ dependencies = [
"miniz_oxide 0.8.9",
]
+[[package]]
+name = "polling"
+version = "3.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218"
+dependencies = [
+ "cfg-if",
+ "concurrent-queue",
+ "hermit-abi",
+ "pin-project-lite",
+ "rustix",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "portable-atomic"
version = "1.15.0"
@@ -2918,13 +3282,24 @@ version = "6.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf"
+[[package]]
+name = "rand"
+version = "0.8.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c"
+dependencies = [
+ "libc",
+ "rand_chacha 0.3.1",
+ "rand_core 0.6.4",
+]
+
[[package]]
name = "rand"
version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41"
dependencies = [
- "rand_chacha",
+ "rand_chacha 0.9.0",
"rand_core 0.9.5",
]
@@ -2939,6 +3314,16 @@ dependencies = [
"rand_core 0.10.1",
]
+[[package]]
+name = "rand_chacha"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
+dependencies = [
+ "ppv-lite86",
+ "rand_core 0.6.4",
+]
+
[[package]]
name = "rand_chacha"
version = "0.9.0"
@@ -2949,6 +3334,15 @@ dependencies = [
"rand_core 0.9.5",
]
+[[package]]
+name = "rand_core"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
+dependencies = [
+ "getrandom 0.2.17",
+]
+
[[package]]
name = "rand_core"
version = "0.9.5"
@@ -3324,6 +3718,25 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+[[package]]
+name = "secret-service"
+version = "4.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e4d35ad99a181be0a60ffcbe85d680d98f87bdc4d7644ade319b87076b9dbfd4"
+dependencies = [
+ "aes",
+ "cbc",
+ "futures-util",
+ "generic-array",
+ "hkdf",
+ "num",
+ "once_cell",
+ "rand 0.8.8",
+ "serde",
+ "sha2",
+ "zbus",
+]
+
[[package]]
name = "selectors"
version = "0.36.1"
@@ -3524,6 +3937,17 @@ dependencies = [
"stable_deref_trait",
]
+[[package]]
+name = "sha1"
+version = "0.10.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba"
+dependencies = [
+ "cfg-if",
+ "cpufeatures 0.2.17",
+ "digest",
+]
+
[[package]]
name = "sha2"
version = "0.10.9"
@@ -3541,6 +3965,16 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba"
+[[package]]
+name = "signal-hook-registry"
+version = "1.4.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b"
+dependencies = [
+ "errno",
+ "libc",
+]
+
[[package]]
name = "simd-adler32"
version = "0.3.10"
@@ -3629,6 +4063,12 @@ version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596"
+[[package]]
+name = "static_assertions"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
+
[[package]]
name = "string_cache"
version = "0.9.0"
@@ -4355,9 +4795,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100"
dependencies = [
"pin-project-lite",
+ "tracing-attributes",
"tracing-core",
]
+[[package]]
+name = "tracing-attributes"
+version = "0.1.31"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
+
[[package]]
name = "tracing-core"
version = "0.1.36"
@@ -4407,6 +4859,17 @@ version = "1.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20"
+[[package]]
+name = "uds_windows"
+version = "1.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f2f6fb2847f6742cd76af783a2a2c49e9375d0a111c7bef6f71cd9e738c72d6e"
+dependencies = [
+ "memoffset",
+ "tempfile",
+ "windows-sys 0.61.2",
+]
+
[[package]]
name = "unic-char-property"
version = "0.9.0"
@@ -5264,6 +5727,16 @@ dependencies = [
"pkg-config",
]
+[[package]]
+name = "xdg-home"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec1cdab258fb55c0da61328dc52c8764709b249011b2cad0454c72f0bf10a1f6"
+dependencies = [
+ "libc",
+ "windows-sys 0.59.0",
+]
+
[[package]]
name = "yoke"
version = "0.8.3"
@@ -5287,6 +5760,62 @@ dependencies = [
"synstructure",
]
+[[package]]
+name = "zbus"
+version = "4.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bb97012beadd29e654708a0fdb4c84bc046f537aecfde2c3ee0a9e4b4d48c725"
+dependencies = [
+ "async-broadcast",
+ "async-process",
+ "async-recursion",
+ "async-trait",
+ "enumflags2",
+ "event-listener",
+ "futures-core",
+ "futures-sink",
+ "futures-util",
+ "hex",
+ "nix",
+ "ordered-stream",
+ "rand 0.8.8",
+ "serde",
+ "serde_repr",
+ "sha1",
+ "static_assertions",
+ "tracing",
+ "uds_windows",
+ "windows-sys 0.52.0",
+ "xdg-home",
+ "zbus_macros",
+ "zbus_names",
+ "zvariant",
+]
+
+[[package]]
+name = "zbus_macros"
+version = "4.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "267db9407081e90bbfa46d841d3cbc60f59c0351838c4bc65199ecd79ab1983e"
+dependencies = [
+ "proc-macro-crate 3.5.0",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+ "zvariant_utils",
+]
+
+[[package]]
+name = "zbus_names"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4b9b1fef7d021261cc16cba64c351d291b715febe0fa10dc3a443ac5a5022e6c"
+dependencies = [
+ "serde",
+ "static_assertions",
+ "zvariant",
+]
+
[[package]]
name = "zerocopy"
version = "0.8.57"
@@ -5333,6 +5862,20 @@ name = "zeroize"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e"
+dependencies = [
+ "zeroize_derive",
+]
+
+[[package]]
+name = "zeroize_derive"
+version = "1.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
[[package]]
name = "zerotrie"
@@ -5378,3 +5921,40 @@ name = "zmij"
version = "1.0.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b"
+
+[[package]]
+name = "zvariant"
+version = "4.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2084290ab9a1c471c38fc524945837734fbf124487e105daec2bb57fd48c81fe"
+dependencies = [
+ "endi",
+ "enumflags2",
+ "serde",
+ "static_assertions",
+ "zvariant_derive",
+]
+
+[[package]]
+name = "zvariant_derive"
+version = "4.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73e2ba546bda683a90652bac4a279bc146adad1386f25379cf73200d2002c449"
+dependencies = [
+ "proc-macro-crate 3.5.0",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+ "zvariant_utils",
+]
+
+[[package]]
+name = "zvariant_utils"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c51bcff7cc3dbb5055396bcf774748c3dab426b4b8659046963523cee4808340"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.119",
+]
diff --git a/crates/quince-auth/Cargo.toml b/crates/quince-auth/Cargo.toml
index 8c7937f..4c11b15 100644
--- a/crates/quince-auth/Cargo.toml
+++ b/crates/quince-auth/Cargo.toml
@@ -19,7 +19,11 @@ hmac = "0.12"
rand = "0.9"
reqwest_cookie_store = "0.8"
cookie_store = { version = "0.21", features = ["serde_json"] }
-keyring = { version = "3", features = ["linux-native"] }
+# `linux-native` selects the KERNEL keyutils backend, which is session-scoped and does not
+# survive a reboot — the trust token would quietly evaporate and the app would ask for a code
+# again, the exact failure this project exists to fix. The Secret Service backend is the
+# persistent one (gnome-keyring / kwallet).
+keyring = { version = "3", default-features = false, features = ["sync-secret-service", "crypto-rust"] }
thiserror = "2"
[dev-dependencies]
diff --git a/crates/quince-auth/src/session.rs b/crates/quince-auth/src/session.rs
index d073e2d..a7745fb 100644
--- a/crates/quince-auth/src/session.rs
+++ b/crates/quince-auth/src/session.rs
@@ -177,9 +177,27 @@ impl Store {
pub fn save(&self, session: &Session) -> Result<(), crate::Error> {
let json = serde_json::to_string(session)?;
match &self.backend {
- Backend::Keyring => Self::entry()
- .and_then(|e| e.set_password(&json))
- .map_err(|e| crate::Error::Keyring(e.to_string())),
+ Backend::Keyring => {
+ Self::entry()
+ .and_then(|e| e.set_password(&json))
+ .map_err(|e| crate::Error::Keyring(e.to_string()))?;
+
+ // Storing the trust token is the whole reason sign-in survives a restart, so
+ // prove it landed rather than assume. A keyring that accepts a write and
+ // loses it looks identical to working until the user reopens the app.
+ if session.trust_token.is_some() {
+ let stored = Self::entry().and_then(|e| e.get_password()).ok();
+ if stored.as_deref() != Some(json.as_str()) {
+ return Err(crate::Error::Keyring(
+ "the system keyring accepted the sign-in but did not keep it. \
+ Check that a keyring service (gnome-keyring or kwallet) is \
+ running and unlocked"
+ .into(),
+ ));
+ }
+ }
+ Ok(())
+ }
Backend::File(path) => Ok(std::fs::write(path, json)?),
}
}
diff --git a/crates/quince-core/src/lib.rs b/crates/quince-core/src/lib.rs
index 8a7cb4c..49bc8e9 100644
--- a/crates/quince-core/src/lib.rs
+++ b/crates/quince-core/src/lib.rs
@@ -5,6 +5,7 @@
//! it. That is the whole reason the app can be instant and work offline.
pub mod calendar;
+pub mod reminders;
pub mod schema;
use rusqlite::Connection;
diff --git a/crates/quince-core/src/reminders.rs b/crates/quince-core/src/reminders.rs
new file mode 100644
index 0000000..187ccf2
--- /dev/null
+++ b/crates/quince-core/src/reminders.rs
@@ -0,0 +1,249 @@
+//! Reminder lists and reminders in the local library.
+
+use crate::{Library, Result};
+use rusqlite::params;
+use serde::{Deserialize, Serialize};
+
+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
+#[serde(rename_all = "camelCase")]
+pub struct ReminderList {
+ pub guid: String,
+ pub title: String,
+ pub colour: Option<String>,
+ pub ctag: Option<String>,
+ pub sort_order: i64,
+ pub enabled: bool,
+}
+
+#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
+#[serde(rename_all = "camelCase")]
+pub struct Reminder {
+ pub guid: String,
+ pub list_guid: String,
+ pub title: String,
+ pub notes: Option<String>,
+ pub due_at: Option<i64>,
+ /// `None` while outstanding.
+ pub completed_at: Option<i64>,
+ pub priority: i64,
+ pub etag: Option<String>,
+}
+
+impl Reminder {
+ #[must_use]
+ pub fn is_done(&self) -> bool {
+ self.completed_at.is_some()
+ }
+}
+
+fn now() -> i64 {
+ std::time::SystemTime::now()
+ .duration_since(std::time::UNIX_EPOCH)
+ .map_or(0, |d| i64::try_from(d.as_secs()).unwrap_or(i64::MAX))
+}
+
+impl Library {
+ /// Replace the set of lists, dropping any Apple no longer reports.
+ pub fn put_reminder_lists(&mut self, lists: &[ReminderList]) -> Result<()> {
+ let tx = self.conn.transaction()?;
+ {
+ let mut stmt = tx.prepare(
+ "INSERT INTO reminder_lists (guid, title, colour, ctag, sort_order, enabled, updated_at)
+ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7)
+ ON CONFLICT(guid) DO UPDATE SET
+ title = excluded.title, colour = excluded.colour, ctag = excluded.ctag,
+ sort_order = excluded.sort_order, enabled = excluded.enabled,
+ updated_at = excluded.updated_at",
+ )?;
+ let stamp = now();
+ for l in lists {
+ stmt.execute(params![
+ l.guid,
+ l.title,
+ l.colour,
+ l.ctag,
+ l.sort_order,
+ i64::from(l.enabled),
+ stamp
+ ])?;
+ }
+ let keep: Vec<&str> = lists.iter().map(|l| l.guid.as_str()).collect();
+ if keep.is_empty() {
+ tx.execute("DELETE FROM reminder_lists", [])?;
+ } else {
+ let placeholders = vec!["?"; keep.len()].join(",");
+ tx.execute(
+ &format!("DELETE FROM reminder_lists WHERE guid NOT IN ({placeholders})"),
+ rusqlite::params_from_iter(keep),
+ )?;
+ }
+ }
+ tx.commit()?;
+ Ok(())
+ }
+
+ pub fn put_reminders(&mut self, reminders: &[Reminder]) -> Result<()> {
+ let tx = self.conn.transaction()?;
+ {
+ let mut stmt = tx.prepare(
+ "INSERT INTO reminders (guid, list_guid, title, notes, due_at, completed_at,
+ priority, etag, updated_at)
+ VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9)
+ ON CONFLICT(guid) DO UPDATE SET
+ list_guid = excluded.list_guid, title = excluded.title,
+ notes = excluded.notes, due_at = excluded.due_at,
+ completed_at = excluded.completed_at, priority = excluded.priority,
+ etag = excluded.etag, updated_at = excluded.updated_at",
+ )?;
+ let stamp = now();
+ for r in reminders {
+ stmt.execute(params![
+ r.guid,
+ r.list_guid,
+ r.title,
+ r.notes,
+ r.due_at,
+ r.completed_at,
+ r.priority,
+ r.etag,
+ stamp
+ ])?;
+ }
+ }
+ tx.commit()?;
+ Ok(())
+ }
+
+ pub fn reminder_lists(&self) -> Result<Vec<ReminderList>> {
+ let mut stmt = self.conn.prepare(
+ "SELECT guid, title, colour, ctag, sort_order, enabled
+ FROM reminder_lists ORDER BY sort_order, title",
+ )?;
+ let rows = stmt.query_map([], |row| {
+ Ok(ReminderList {
+ guid: row.get(0)?,
+ title: row.get(1)?,
+ colour: row.get(2)?,
+ ctag: row.get(3)?,
+ sort_order: row.get(4)?,
+ enabled: row.get::<_, i64>(5)? != 0,
+ })
+ })?;
+ Ok(rows.collect::<rusqlite::Result<Vec<_>>>()?)
+ }
+
+ /// Reminders in a list, outstanding first, then by due date.
+ ///
+ /// Ordering matters: a list that buries today's task under last month's completed ones
+ /// is useless.
+ pub fn reminders_in(&self, list_guid: &str, include_done: bool) -> Result<Vec<Reminder>> {
+ let mut stmt = self.conn.prepare(
+ "SELECT guid, list_guid, title, notes, due_at, completed_at, priority, etag
+ FROM reminders
+ WHERE list_guid = ?1 AND (?2 = 1 OR completed_at IS NULL)
+ ORDER BY completed_at IS NOT NULL,
+ due_at IS NULL, due_at,
+ priority DESC,
+ title",
+ )?;
+ let rows = stmt.query_map(params![list_guid, i64::from(include_done)], |row| {
+ Ok(Reminder {
+ guid: row.get(0)?,
+ list_guid: row.get(1)?,
+ title: row.get(2)?,
+ notes: row.get(3)?,
+ due_at: row.get(4)?,
+ completed_at: row.get(5)?,
+ priority: row.get(6)?,
+ etag: row.get(7)?,
+ })
+ })?;
+ Ok(rows.collect::<rusqlite::Result<Vec<_>>>()?)
+ }
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+
+ fn list(guid: &str) -> ReminderList {
+ ReminderList {
+ guid: guid.into(),
+ title: format!("List {guid}"),
+ colour: Some("#cc73e1".into()),
+ ctag: None,
+ sort_order: 0,
+ enabled: true,
+ }
+ }
+
+ fn reminder(guid: &str, due: Option<i64>, done: Option<i64>) -> Reminder {
+ Reminder {
+ guid: guid.into(),
+ list_guid: "l1".into(),
+ title: guid.into(),
+ notes: None,
+ due_at: due,
+ completed_at: done,
+ priority: 0,
+ etag: None,
+ }
+ }
+
+ fn seeded() -> Library {
+ let mut lib = Library::in_memory().unwrap();
+ lib.put_reminder_lists(&[list("l1")]).unwrap();
+ lib
+ }
+
+ #[test]
+ fn outstanding_reminders_come_before_completed_ones() {
+ let mut lib = seeded();
+ lib.put_reminders(&[
+ reminder("done", Some(100), Some(150)),
+ reminder("undated", None, None),
+ reminder("due-soon", Some(200), None),
+ ])
+ .unwrap();
+
+ let visible = lib.reminders_in("l1", false).unwrap();
+ assert_eq!(
+ visible.iter().map(|r| r.guid.as_str()).collect::<Vec<_>>(),
+ vec!["due-soon", "undated"],
+ "dated items first, and completed ones hidden"
+ );
+
+ let all = lib.reminders_in("l1", true).unwrap();
+ assert_eq!(
+ all.last().unwrap().guid,
+ "done",
+ "completed items sink to the bottom"
+ );
+ }
+
+ #[test]
+ fn deleting_a_list_takes_its_reminders() {
+ let mut lib = seeded();
+ lib.put_reminders(&[reminder("r1", None, None)]).unwrap();
+ lib.put_reminder_lists(&[]).unwrap();
+ assert!(lib.reminders_in("l1", true).unwrap().is_empty());
+ }
+
+ #[test]
+ fn ticking_a_reminder_updates_it_rather_than_duplicating() {
+ let mut lib = seeded();
+ lib.put_reminders(&[reminder("r1", None, None)]).unwrap();
+ lib.put_reminders(&[reminder("r1", None, Some(999))])
+ .unwrap();
+
+ let all = lib.reminders_in("l1", true).unwrap();
+ assert_eq!(all.len(), 1);
+ assert!(all[0].is_done());
+ }
+
+ #[test]
+ fn an_existing_library_migrates_to_the_new_schema() {
+ let lib = Library::in_memory().unwrap();
+ assert_eq!(lib.schema_version().unwrap(), 2, "migration 2 must apply");
+ }
+}
diff --git a/crates/quince-core/src/schema.rs b/crates/quince-core/src/schema.rs
index dcb0007..a43f7f6 100644
--- a/crates/quince-core/src/schema.rs
+++ b/crates/quince-core/src/schema.rs
@@ -48,4 +48,33 @@ pub const MIGRATIONS: &[&str] = &[
last_error TEXT
) STRICT;
"#,
+ // 2 — reminder lists and reminders.
+ r#"
+ CREATE TABLE reminder_lists (
+ guid TEXT PRIMARY KEY,
+ title TEXT NOT NULL,
+ colour TEXT,
+ ctag TEXT,
+ sort_order INTEGER NOT NULL DEFAULT 0,
+ enabled INTEGER NOT NULL DEFAULT 1,
+ updated_at INTEGER NOT NULL
+ ) STRICT;
+
+ CREATE TABLE reminders (
+ guid TEXT PRIMARY KEY,
+ list_guid TEXT NOT NULL REFERENCES reminder_lists(guid) ON DELETE CASCADE,
+ title TEXT NOT NULL,
+ notes TEXT,
+ -- Unix seconds, UTC. Null means no due date, which is the common case.
+ due_at INTEGER,
+ -- Null while outstanding; the completion instant once ticked off.
+ completed_at INTEGER,
+ priority INTEGER NOT NULL DEFAULT 0,
+ etag TEXT,
+ updated_at INTEGER NOT NULL
+ ) STRICT;
+
+ CREATE INDEX reminders_by_list ON reminders (list_guid, completed_at, due_at);
+ CREATE INDEX reminders_by_due ON reminders (due_at);
+ "#,
];
diff --git a/crates/quince-icloud/src/calendar.rs b/crates/quince-icloud/src/calendar.rs
index 0292921..21e4563 100644
--- a/crates/quince-icloud/src/calendar.rs
+++ b/crates/quince-icloud/src/calendar.rs
@@ -14,7 +14,7 @@ use serde_json::Value;
/// Converting needs the zone, because the same wall-clock reading means different instants in
/// different places. A missing or unknown zone falls back to UTC rather than failing the whole
/// sync over one event.
-fn parse_apple_date(raw: &Value, timezone: Option<&str>) -> Result<i64> {
+pub(crate) fn parse_apple_date(raw: &Value, timezone: Option<&str>) -> Result<i64> {
let parts = raw
.as_array()
.ok_or_else(|| Error::Protocol("a date was not an array".into()))?;
diff --git a/crates/quince-icloud/src/lib.rs b/crates/quince-icloud/src/lib.rs
index f910000..1c8ca91 100644
--- a/crates/quince-icloud/src/lib.rs
+++ b/crates/quince-icloud/src/lib.rs
@@ -4,6 +4,7 @@
//! untrusted: a missing field or a malformed date returns an error, never a panic.
pub mod calendar;
+pub mod reminders;
pub mod sync;
#[derive(Debug, thiserror::Error)]
diff --git a/crates/quince-icloud/src/reminders.rs b/crates/quince-icloud/src/reminders.rs
new file mode 100644
index 0000000..fab5dd3
--- /dev/null
+++ b/crates/quince-icloud/src/reminders.rs
@@ -0,0 +1,220 @@
+//! Apple's reminders web service.
+//!
+//! `/rd/startup` returns the lists and their reminders in one call — unlike calendar, there
+//! is no date window to chunk.
+
+use crate::calendar::parse_apple_date;
+use crate::{Error, Result};
+use quince_core::reminders::{Reminder, ReminderList};
+use serde_json::Value;
+
+fn string(v: &Value, key: &str) -> Option<String> {
+ v.get(key)
+ .and_then(Value::as_str)
+ .filter(|s| !s.is_empty())
+ .map(ToString::to_string)
+}
+
+/// Apple's date arrays appear here too. A malformed one loses the date, not the reminder —
+/// a task with an unreadable due date is still a task.
+fn optional_date(v: &Value, key: &str) -> Option<i64> {
+ let raw = v.get(key)?;
+ if raw.is_null() {
+ return None;
+ }
+ parse_apple_date(raw, None).ok()
+}
+
+fn list_from(v: &Value) -> Option<ReminderList> {
+ Some(ReminderList {
+ guid: string(v, "guid")?,
+ title: string(v, "title").unwrap_or_else(|| "Reminders".into()),
+ colour: string(v, "color"),
+ ctag: string(v, "ctag"),
+ sort_order: v.get("order").and_then(Value::as_i64).unwrap_or(0),
+ enabled: v.get("enabled").and_then(Value::as_bool).unwrap_or(true),
+ })
+}
+
+fn reminder_from(v: &Value) -> Option<Reminder> {
+ let guid = string(v, "guid")?;
+ let list_guid = string(v, "pGuid")?;
+ Some(Reminder {
+ guid,
+ list_guid,
+ title: string(v, "title").unwrap_or_else(|| "Untitled".into()),
+ notes: string(v, "description"),
+ due_at: optional_date(v, "dueDate"),
+ completed_at: optional_date(v, "completedDate"),
+ priority: v.get("priority").and_then(Value::as_i64).unwrap_or(0),
+ etag: string(v, "etag"),
+ })
+}
+
+#[derive(Debug, Default)]
+pub struct Snapshot {
+ pub lists: Vec<ReminderList>,
+ pub reminders: Vec<Reminder>,
+}
+
+/// Read a `/rd/startup` body.
+///
+/// Apple returns outstanding reminders under `Reminders` and finished ones under `Completed`,
+/// so both are read — a list showing only open items is not the same as Apple's.
+pub fn parse_snapshot(body: &Value) -> Snapshot {
+ let lists = body
+ .get("Collections")
+ .and_then(Value::as_array)
+ .map(|arr| arr.iter().filter_map(list_from).collect())
+ .unwrap_or_default();
+
+ let mut reminders: Vec<Reminder> = Vec::new();
+ for key in ["Reminders", "Completed"] {
+ if let Some(arr) = body.get(key).and_then(Value::as_array) {
+ reminders.extend(arr.iter().filter_map(reminder_from));
+ }
+ }
+
+ Snapshot { lists, reminders }
+}
+
+pub struct RemindersClient<'a> {
+ http: &'a reqwest::Client,
+ root: String,
+ params: Vec<(String, String)>,
+}
+
+impl<'a> RemindersClient<'a> {
+ pub fn new(http: &'a reqwest::Client, root: &str, params: Vec<(String, String)>) -> Self {
+ Self {
+ http,
+ root: root.trim_end_matches('/').to_string(),
+ params,
+ }
+ }
+
+ pub async fn startup(&self, timezone: &str) -> Result<Snapshot> {
+ let mut query = self.params.clone();
+ query.push(("clientVersion".into(), "4.0".into()));
+ query.push(("lang".into(), "en-us".into()));
+ query.push(("usertz".into(), timezone.into()));
+
+ let response = self
+ .http
+ .get(format!("{}/rd/startup", self.root))
+ .query(&query)
+ .send()
+ .await?;
+ let status = response.status();
+ let text = response.text().await.unwrap_or_default();
+
+ if status.as_u16() == 450 {
+ return Err(Error::ReauthRequired);
+ }
+ if !status.is_success() {
+ return Err(Error::Protocol(format!(
+ "/rd/startup returned {status}: {}",
+ text.chars().take(160).collect::<String>()
+ )));
+ }
+ let body: Value = serde_json::from_str(&text)
+ .map_err(|e| Error::Protocol(format!("/rd/startup returned invalid JSON: {e}")))?;
+ Ok(parse_snapshot(&body))
+ }
+}
+
+/// Reconcile reminders into the local library.
+pub async fn sync(
+ http: &reqwest::Client,
+ root: &str,
+ params: Vec<(String, String)>,
+ library: &mut quince_core::Library,
+ timezone: &str,
+) -> Result<(usize, usize)> {
+ let client = RemindersClient::new(http, root, params);
+ let snapshot = client.startup(timezone).await?;
+
+ library.put_reminder_lists(&snapshot.lists)?;
+
+ // Drop reminders whose list Apple did not report: they would fail the foreign key.
+ let known: std::collections::HashSet<&str> =
+ snapshot.lists.iter().map(|l| l.guid.as_str()).collect();
+ let reminders: Vec<_> = snapshot
+ .reminders
+ .iter()
+ .filter(|r| known.contains(r.list_guid.as_str()))
+ .cloned()
+ .collect();
+
+ library.put_reminders(&reminders)?;
+ library.mark_synced("reminders", None)?;
+ Ok((snapshot.lists.len(), reminders.len()))
+}
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use serde_json::json;
+
+ #[test]
+ fn a_snapshot_reads_lists_and_both_states() {
+ let body = json!({
+ "Collections": [{ "guid": "l1", "title": "Groceries", "color": "#cc73e1", "order": 2 }],
+ "Reminders": [
+ { "guid": "r1", "pGuid": "l1", "title": "Milk", "priority": 1,
+ "dueDate": [20260913, 2026, 9, 13, 18, 0, 1080] }
+ ],
+ "Completed": [
+ { "guid": "r2", "pGuid": "l1", "title": "Bread",
+ "completedDate": [20260910, 2026, 9, 10, 9, 0, 540] }
+ ]
+ });
+ let snap = parse_snapshot(&body);
+
+ assert_eq!(snap.lists.len(), 1);
+ assert_eq!(snap.lists[0].title, "Groceries");
+ assert_eq!(snap.lists[0].sort_order, 2);
+
+ assert_eq!(snap.reminders.len(), 2, "finished reminders count too");
+ let open = snap.reminders.iter().find(|r| r.guid == "r1").unwrap();
+ assert!(!open.is_done());
+ assert!(open.due_at.is_some());
+ assert_eq!(open.priority, 1);
+ assert!(snap
+ .reminders
+ .iter()
+ .find(|r| r.guid == "r2")
+ .unwrap()
+ .is_done());
+ }
+
+ /// A reminder with no due date is the common case and must survive.
+ #[test]
+ fn a_reminder_without_a_due_date_is_kept() {
+ let body = json!({ "Reminders": [{ "guid": "r1", "pGuid": "l1", "title": "Someday" }] });
+ let snap = parse_snapshot(&body);
+ assert_eq!(snap.reminders.len(), 1);
+ assert!(snap.reminders[0].due_at.is_none());
+ }
+
+ /// An unreadable date loses the date, not the task.
+ #[test]
+ fn a_malformed_due_date_does_not_lose_the_reminder() {
+ let body = json!({ "Reminders": [
+ { "guid": "r1", "pGuid": "l1", "title": "Odd", "dueDate": "not-an-array" }
+ ]});
+ let snap = parse_snapshot(&body);
+ assert_eq!(snap.reminders.len(), 1);
+ assert!(snap.reminders[0].due_at.is_none());
+ }
+
+ #[test]
+ fn entries_without_identity_are_skipped() {
+ let body = json!({ "Reminders": [
+ { "title": "no guid" },
+ { "guid": "r1", "title": "no list" },
+ { "guid": "r2", "pGuid": "l1", "title": "fine" }
+ ]});
+ assert_eq!(parse_snapshot(&body).reminders.len(), 1);
+ }
+}
diff --git a/probe/src/main.rs b/probe/src/main.rs
index 6224606..10df968 100644
--- a/probe/src/main.rs
+++ b/probe/src/main.rs
@@ -582,6 +582,50 @@ async fn main() -> Result<()> {
println!(" Apple offered no calendar service for this account");
}
+ // ---- Reminders, end to end --------------------------------------------------
+ println!("\n\x1b[1m── Reminders sync (the real path the app uses) ──\x1b[0m");
+ if let Some(root) = session.service_url("reminders") {
+ let params = client.service_params();
+ let http = client.http().clone();
+ match quince_core::Library::open(&dir) {
+ Err(e) => println!(" \x1b[31mcouldn't open the local library:\x1b[0m {e}"),
+ Ok(mut library) => {
+ match quince_icloud::reminders::sync(
+ &http,
+ &root,
+ params,
+ &mut library,
+ "Asia/Kolkata",
+ )
+ .await
+ {
+ Err(e) => println!(" \x1b[31mFAIL\x1b[0m {e}"),
+ Ok((lists, count)) => {
+ println!(" \x1b[32mPASS\x1b[0m {lists} list(s), {count} reminder(s)");
+ for l in library.reminder_lists().unwrap_or_default() {
+ let items = library.reminders_in(&l.guid, true).unwrap_or_default();
+ println!(
+ " {:<24} {:<9} {} item(s)",
+ l.title,
+ l.colour.unwrap_or_else(|| "—".into()),
+ items.len()
+ );
+ for r in items.iter().take(6) {
+ println!(
+ " [{}] {}",
+ if r.is_done() { "x" } else { " " },
+ r.title
+ );
+ }
+ }
+ }
+ }
+ }
+ }
+ } else {
+ println!(" Apple offered no reminders service for this account");
+ }
+
// ---- 5. verdict -------------------------------------------------------------
let passed = results.iter().filter(|r| r.ok).count();
println!("\n\x1b[1m── Verdict ──\x1b[0m");
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index c7f390b..c711849 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -3,6 +3,7 @@
use quince_auth::{Client, SignInOutcome, TwoFactorOptions};
use quince_core::calendar::{Calendar, Event};
+use quince_core::reminders::{Reminder, ReminderList};
use quince_core::Library;
use serde::Serialize;
use std::path::PathBuf;
@@ -213,6 +214,51 @@ async fn calendar_list(data: State<'_, Data>) -> UiResult<Vec<Calendar>> {
library.calendars().map_err(|e| e.to_string())
}
+/// Refresh reminders from Apple. Unlike calendar there is no date window, so one call.
+#[tauri::command]
+async fn reminders_sync(
+ timezone: String,
+ auth: State<'_, Auth>,
+ data: State<'_, Data>,
+) -> UiResult<(usize, usize)> {
+ let (http, root, params) = {
+ let client = auth.client.lock().await;
+ let root = client
+ .session()
+ .service_url("reminders")
+ .ok_or("Apple hasn't offered a reminders service for this account.")?;
+ (client.http().clone(), root, client.service_params())
+ };
+ let mut library = data.0.lock().await;
+ quince_icloud::reminders::sync(&http, &root, params, &mut library, &timezone)
+ .await
+ .map_err(|e| e.to_string())
+}
+
+#[tauri::command]
+async fn reminder_lists(data: State<'_, Data>) -> UiResult<Vec<ReminderList>> {
+ let library = data.0.lock().await;
+ library.reminder_lists().map_err(|e| e.to_string())
+}
+
+#[tauri::command]
+async fn reminders_in(
+ list_guid: String,
+ include_done: bool,
+ data: State<'_, Data>,
+) -> UiResult<Vec<Reminder>> {
+ let library = data.0.lock().await;
+ library
+ .reminders_in(&list_guid, include_done)
+ .map_err(|e| e.to_string())
+}
+
+#[tauri::command]
+async fn reminders_last_synced(data: State<'_, Data>) -> UiResult<Option<i64>> {
+ let library = data.0.lock().await;
+ library.last_synced("reminders").map_err(|e| e.to_string())
+}
+
/// When the calendar last synced, as unix seconds.
#[tauri::command]
async fn calendar_last_synced(data: State<'_, Data>) -> UiResult<Option<i64>> {
@@ -250,6 +296,10 @@ fn main() {
calendar_events,
calendar_list,
calendar_last_synced,
+ reminders_sync,
+ reminder_lists,
+ reminders_in,
+ reminders_last_synced,
])
.run(tauri::generate_context!())
.expect("Quince failed to start");