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.

Contacts and Drive: initials still match, and an empty upload is never cut off

Yashwanth Kamireddi7b3e07c6f37b
diff --git a/crates/quince-core/src/contacts_merge.rs b/crates/quince-core/src/contacts_merge.rs
index e08fb0f..140c512 100644
--- a/crates/quince-core/src/contacts_merge.rs
+++ b/crates/quince-core/src/contacts_merge.rs
@@ -83,14 +83,21 @@ fn same_person(a: &Option<String>, b: &Option<String>) -> bool {
let (Some(a), Some(b)) = (a, b) else {
return true;
};
- let (a, b): (Vec<&str>, Vec<&str>) = (a.split(' ').collect(), b.split(' ').collect());
+ // An initial is its letter: "Z." is the start of "Zoe".
+ let words = |n: &str| -> Vec<String> {
+ n.split(' ')
+ .map(|w| w.trim_end_matches('.').to_string())
+ .filter(|w| !w.is_empty())
+ .collect()
+ };
+ let (a, b) = (words(a), words(b));
let (short, long) = if a.len() <= b.len() { (a, b) } else { (b, a) };
let mut used = vec![false; long.len()];
short.iter().all(|w| {
let found = long
.iter()
.enumerate()
- .find(|(k, l)| !used[*k] && (l.starts_with(w) || w.starts_with(*l)));
+ .find(|(k, l)| !used[*k] && (l.starts_with(w.as_str()) || w.starts_with(l.as_str())));
found.map(|(k, _)| used[k] = true).is_some()
})
}
diff --git a/probe/examples/heic_check.rs b/probe/examples/heic_check.rs
index f46686e..39a541b 100644
--- a/probe/examples/heic_check.rs
+++ b/probe/examples/heic_check.rs
@@ -14,7 +14,7 @@ async fn main() -> Result<()> {
.service_url("ckdatabasews")
.ok_or_else(|| anyhow!("no ck"))?;
let (http, p) = (client.http().clone(), client.service_params());
- let links = quince_icloud::photos::links(&http, &root, p, master)
+ let links = quince_icloud::photos::links(&http, &root, p, master, master)
.await?
.ok_or_else(|| anyhow!("no links"))?;
let url = links.original.ok_or_else(|| anyhow!("no original"))?;
diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs
index 43a1b8d..7402c74 100644
--- a/src-tauri/src/main.rs
+++ b/src-tauri/src/main.rs
@@ -4608,10 +4608,15 @@ async fn drive_upload(
params.clone(),
);
let (abort, registration) = futures_util::future::AbortHandle::new_pair();
- uploads_running()
- .lock()
- .map(|mut m| m.insert(job.event.id.clone(), abort))
- .ok();
+ // An empty file has no bytes to report, so nothing ever took its stop away before it
+ // was filed: a Cancel then could cut its filing short and call it cancelled while it
+ // was in iCloud. Waiting, it is still stopped (`upload_stopped`); begun, it finishes.
+ if job.event.total > 0 {
+ uploads_running()
+ .lock()
+ .map(|mut m| m.insert(job.event.id.clone(), abort))
+ .ok();
+ }
let id = job.event.id.clone();
let cancelled_event = {
let mut e = job.event.clone();