Merge main (upstream v0.16.24) into feature/compliance-roles
ci / fork-checks (pull_request) Successful in 15s
ci / build (pull_request) Successful in 7m33s

The schema conflicted as a binary file: taken from main and the one
edit here re-applied (sysComplianceGet after sysLegalHoldExport). The
import kept the permission count at 673, so the new id stays 673.

Retested on the merged tree in its own target directory: the
compliance and system suites pass. One earlier system run failed in
purge.rs (an imported blob not found) and didn't recur.
This commit is contained in:
2026-09-28 09:26:27 -07:00
96 changed files with 4212 additions and 1066 deletions
+43 -19
View File
@@ -6,7 +6,7 @@
* Modified by Coffey Labs in 2026 for INBUXA.
*/
use crate::utils::{account::Account, server::TestServer};
use crate::utils::{account::Account, jmap::JmapUtils, server::TestServer};
use registry::{
schema::{
enums::TaskStoreMaintenanceType,
@@ -301,14 +301,29 @@ impl Account {
.await
}
pub async fn tasks(&self) -> Vec<TaskId> {
pub async fn tasks(&self) -> Option<Vec<TaskId>> {
let ids = self.task_ids().await;
let mut results = Vec::with_capacity(ids.len());
for id in ids {
let sample = self.registry_get::<Task>(id).await;
results.push(TaskId { id, task: sample });
if ids.is_empty() {
return Some(Vec::new());
}
results
let response = self.registry_get_many(ObjectType::Task, &ids).await;
if response.not_found().next().is_some() {
return None;
}
Some(
response
.list()
.iter()
.map(|item| TaskId {
id: item.object_id(),
task: serde_json::from_str(&item.to_string()).unwrap_or_else(|err| {
panic!("Failed to deserialize {item}: {err}");
}),
})
.collect(),
)
}
async fn assert_no_tasks(&self) {
@@ -344,19 +359,28 @@ impl Account {
) -> Vec<TaskId> {
let mut attempt = 0;
loop {
let tasks = self.tasks().await;
if tasks.len() == count && tasks.iter().all(&is_expected) {
return tasks;
match self.tasks().await {
Some(tasks) if tasks.len() == count && tasks.iter().all(&is_expected) => {
return tasks;
}
Some(tasks) => {
attempt += 1;
assert!(
attempt < TASK_WAIT_ATTEMPTS,
"Expected {} tasks, found {}: {:?}",
count,
tasks.len(),
tasks
);
}
None => {
attempt += 1;
assert!(
attempt < TASK_WAIT_ATTEMPTS,
"Task/query keeps returning ids that Task/get reports as not found"
);
}
}
attempt += 1;
assert!(
attempt < TASK_WAIT_ATTEMPTS,
"Expected {} tasks, found {}: {:?}",
count,
tasks.len(),
tasks
);
tokio::time::sleep(TASK_WAIT_INTERVAL).await;
}
}