test(desktop): cover exact workflow batch limit (#6168)

## Summary

- retain explicit regression coverage for the exact 128-channel relay
request limit
- cover the 129-channel split into 128 + 1 filters

The workflow-listing implementation originally carried by this PR landed
through #6009. This branch is now rebased onto current `main`, so the
remaining diff is only the boundary test that #6009 did not include.

Fixes #6116

## Test plan

- `cargo test --manifest-path desktop/src-tauri/Cargo.toml
workflow_queries_respect_relay_explicit_channel_limit`
- pre-push hook: Desktop checks, Desktop tests, Desktop Tauri checks,
and path-scoped Rust tests

Signed-off-by: Wes <wesbillman@users.noreply.github.com>
Co-authored-by: Carl <c7ebe626f000404285d3686e1dc74cc07cc60a9754a150041ba132e14bd3e2ec@buzz.block.builderlab.xyz>
This commit is contained in:
Wes
2026-08-17 16:47:07 -07:00
committed by GitHub
co-authored by Carl
parent c8c8eb58ad
commit f8692fa9b5
@@ -216,18 +216,24 @@ fn multi_channel_workflow_query_uses_one_filter_per_channel() {
}
#[test]
fn workflow_queries_batch_above_relay_explicit_channel_limit() {
let channel_ids = (0..WORKFLOW_QUERY_CHANNEL_BATCH_SIZE + 1)
.map(|index| uuid::Uuid::from_u128(index as u128 + 1).to_string())
.collect();
let batches = channel_workflow_filter_batches(channel_ids).expect("valid channels");
fn workflow_queries_respect_relay_explicit_channel_limit() {
for (channel_count, expected_batch_sizes) in [
(WORKFLOW_QUERY_CHANNEL_BATCH_SIZE, vec![128]),
(WORKFLOW_QUERY_CHANNEL_BATCH_SIZE + 1, vec![128, 1]),
] {
let channel_ids = (0..channel_count)
.map(|index| uuid::Uuid::from_u128(index as u128 + 1).to_string())
.collect();
let batches = channel_workflow_filter_batches(channel_ids).expect("valid channels");
assert_eq!(batches.len(), 2);
assert_eq!(batches[0].len(), WORKFLOW_QUERY_CHANNEL_BATCH_SIZE);
assert_eq!(batches[1].len(), 1);
assert!(batches.iter().flatten().all(|filter| filter["#h"]
.as_array()
.is_some_and(|values| values.len() == 1)));
assert_eq!(
batches.iter().map(Vec::len).collect::<Vec<_>>(),
expected_batch_sizes
);
assert!(batches.iter().flatten().all(|filter| filter["#h"]
.as_array()
.is_some_and(|values| values.len() == 1)));
}
}
#[test]