`TestInboundFederationKeys` fails if empty `old_verify_keys` is omitted

未关闭 适合新手
#946 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 2 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go
领域
testing

调研方向

失败的检查位于 tests/federation_keys_test.go 的第 74-101 行附近,其中 MatchResponse 配合 JSONMapEach 要求存在 old_verify_keys 键。阅读该代码块,看看其他可选字段是如何处理的,然后将 old_verify_keys 设为可选,使缺失的键可以通过,而存在且格式正确的键仍然会被检查。运行 TestInboundFederationKeys;当测试在省略空字段的服务器上通过时,即视为完成。

由索引模型根据 Issue 内容生成。

描述

This field in /_matrix/key/v2/server is optional, and in Mautrix omitted when empty, but Complement returns an error if it is not present at all:

  ❌ TestInboundFederationKeys (FAIL; 4.75s)
2026/11/03 01:08:53 WARNING: complement_fed_3_fed.1_servers.hs1_1 has a named VOLUME /var/lib/postgresql/data - volumes can lead to unpredictable behaviour due to test pollution. Remove the VOLUME in the Dockerfile to suppress this message.
    federation_keys_test.go:30: Deploy times: 9.103914ms blueprints, 3.450035018s containers
    federation_keys_test.go:45: MatchResponse JSONMapEach: missing key 'old_verify_keys' - https://127.0.0.1:32789/_matrix/key/v2/server => {"server_name":"hs1","signatures":{"hs1":{"ed25519:307d59fc32ee2771e7292fa1c4519e77ce6d6069d0bb78400d1208e48c278abd":"EBzKuwvrcSo2RzONAKAeN76zwdf4OTJxrLFQDeFmOKLq5MFQXFXKwU3cwFH2h19uANQu5wDbxpvy0YNfUUBlCg"}},"valid_until_ts":1793754536056,"verify_keys":{"ed25519:307d59fc32ee2771e7292fa1c4519e77ce6d6069d0bb78400d1208e48c278abd":{"key":"eN5abljPWdwVk+w5MIrl7Ld/KqWVH5+Ms6vnKWxcKBM"}}}  

https://github.com/matrix-org/complement/blob/e3fcff1998d91f71cae096679b3ec737dda69fdd/tests/federation_keys_test.go#L74-L101

主要语言
Go
星标
101
派生
73
平均合并
1 天 2 小时
30 天内合并 PR
3

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

matrix-org/complement 的其他 Issue

查看 matrix-org/complement 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。