yorkie-team / yorkie

Yorkie is a document store for collaborative applications.
https://yorkie.dev
Apache License 2.0
771 stars 143 forks source link

Error occurs when executing `FindDocInfosByKeys` query with empty docKeys argument #943

Closed raararaara closed 1 month ago

raararaara commented 1 month ago

What happened: When performing the FindDocInfosByKeys query with an empty array for docKeys, the server encounters a critical issue. Specifically, the server crashes with the following error:

2024-07-26T01:27:13.710+0900    WARN    a16     RPC : "/yorkie.v1.AdminService/GetDocuments" 
1.773583ms: &{"project_name:\"default\"" {'\x00' "/yorkie.v1.AdminService/GetDocuments" 
%!q(bool=false) '\x00'} {"[::1]:49484" "connect" map[]} map["Authorization":
["cqh6cnh97i624rnkavk0"] "Content-Length":["70"] "Content-Type":["application/json"] "Host":
["localhost:8080"]] "POST"} => "find documents: (BadValue) $in needs an array"

How to reproduce it (as minimally and precisely as possible):

  1. Execute the FindDocInfosByKeys query with an empty array for docKeys.
  2. Observe the server crashing and generating the mentioned error.

Anything else we need to know?:

Environment:

raararaara commented 1 month ago

cc @blurfx