core: the compat forward-compat test builds its feature list from the constants
CI & Build / Python lint (push) Successful in 3s
CI & Build / Build now, or wait for Android? (push) Successful in 3s
Android / Build, or is the channel already serving this? (push) Successful in 4s
Desktop (Tauri) / Build, or is the channel already serving this? (push) Successful in 2s
CI & Build / Web typecheck and unit tests (push) Successful in 12s
CI & Build / Python tests (push) Successful in 16s
CI & Build / integration (push) Successful in 41s
CI & Build / Build & push image (push) Skipped
Desktop (Tauri) / Web tests, clippy, Rust tests and rustfmt (push) Successful in 2m19s
Desktop (Tauri) / Windows installer (cross-compiled) (push) Successful in 2m34s
Desktop (Tauri) / Tauri desktop (Linux) (push) Successful in 3m20s
Desktop (Tauri) / Update manifest (push) Successful in 5s
Android / Kotlin + Rust (APK) (push) Successful in 8m9s

A literal list went stale the moment attachment_sync was added (run 8513), the
same way pinned version numbers did at v2 — for a reason unrelated to what the
test checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-07 10:13:17 -04:00
co-authored by Claude Opus 5.5
parent 2b2ceaa82e
commit 5b11490858
+9 -2
View File
@@ -392,13 +392,20 @@ mod tests {
// must not break the handshake. // must not break the handshake.
// Versions come from the constants, not literals: this test is about unknown // Versions come from the constants, not literals: this test is about unknown
// FIELDS, and pinning the numbers made it fail the moment the protocol moved // FIELDS, and pinning the numbers made it fail the moment the protocol moved
// to v2 — for a reason that has nothing to do with what it checks. // to v2 — for a reason that has nothing to do with what it checks. The feature
// list likewise: a literal one went stale when `attachment_sync` was added.
let features: Vec<&str> = REQUIRED_FEATURES
.iter()
.chain(OPTIONAL_FEATURES.iter())
.copied()
.collect();
let body = format!( let body = format!(
r#"{{"site_name":"S","sync_protocol_version":{v}, r#"{{"site_name":"S","sync_protocol_version":{v},
"min_client_protocol_version":{v}, "min_client_protocol_version":{v},
"sync_features":["notes","labels","attachments","tombstones","revisions"], "sync_features":{f},
"some_future_field":{{"nested":true}}}}"#, "some_future_field":{{"nested":true}}}}"#,
v = CLIENT_PROTOCOL_VERSION, v = CLIENT_PROTOCOL_VERSION,
f = serde_json::to_string(&features).expect("features"),
); );
let info: ServerInfo = serde_json::from_str(&body).expect("unknown fields are ignored"); let info: ServerInfo = serde_json::from_str(&body).expect("unknown fields are ignored");
assert_eq!(evaluate(&info), Compatibility::Ok); assert_eq!(evaluate(&info), Compatibility::Ok);