From 5b1149085893cac2c493ece680dea4de62071e16 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Wed, 7 Oct 2026 10:13:17 -0400 Subject: [PATCH] core: the compat forward-compat test builds its feature list from the constants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- core/src/sync/compat.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/core/src/sync/compat.rs b/core/src/sync/compat.rs index de6ae9c..3ce2495 100644 --- a/core/src/sync/compat.rs +++ b/core/src/sync/compat.rs @@ -392,13 +392,20 @@ mod tests { // must not break the handshake. // 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 - // 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!( r#"{{"site_name":"S","sync_protocol_version":{v}, "min_client_protocol_version":{v}, - "sync_features":["notes","labels","attachments","tombstones","revisions"], + "sync_features":{f}, "some_future_field":{{"nested":true}}}}"#, 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"); assert_eq!(evaluate(&info), Compatibility::Ok);