`TestRoomCreate` fails if the underlying server fails to deserialise an integer room version instead of validating it

Đang mở Phù hợp với người mới
#952 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go
Lĩnh vực
testing-qa

Hướng nghiên cứu

Khẳng định bị lỗi nằm trong subtest POST /createRoom rejects attempts to create rooms with numeric versions thuộc TestRoomCreate, trong apidoc_room_create_test.go. Hãy đọc cách test đó so khớp khóa errcode, và cách các trường hợp từ chối khác trong cùng tệp chấp nhận các mã thay thế. Công việc hoàn tất khi subtest vượt qua với việc máy chủ trả về M_NOT_JSON hoặc M_BAD_JSON cho phiên bản phòng dạng số, và test được chạy lại để xác nhận.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

If a /createRoom request fails to be deserialised into a strongly typed struct because the room version parameter expects a string, but is given an integer, the server will return M_NOT_JSON. However, TestRoomCreate/Parallel/POST_/createRoom_rejects_attempts_to_create_rooms_with_numeric_versions expects M_BAD_JSON instead, which requires that the deserialiser is allowed to ignore incorrect types.

  ❌ TestRoomCreate/Parallel/POST_/createRoom_rejects_attempts_to_create_rooms_with_numeric_versions (FAIL; 230ms)
    apidoc_room_create_test.go:195: MatchResponse key 'errcode' got 'M_NOT_JSON' (type string) want 'M_BAD_JSON' (type string) - http://127.0.0.1:33163/_matrix/client/v3/createRoom => {"errcode":"M_NOT_JSON","error":"failed to parse body as JSON: json: unable to unmarshal JSON number into Go id.RoomVersion within \"/room_version\""}

Accepting M_NOT_JSON and M_BAD_JSON would fix this.

Ngôn ngữ chính
Go
Star
101
Fork
73
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
3

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của matrix-org/complement

Tất cả issue của matrix-org/complement

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.