modrinth / labrinth

Our Rust-based backend utilizing the actix-web framework to serve Modrinth's API.
https://modrinth.com
GNU Affero General Public License v3.0
509 stars 73 forks source link

Setting monetization weights to longer decimals renders members endpoint unaccessable #905

Open brawaru opened 2 months ago

brawaru commented 2 months ago

Describe the bug

If you set monetization weight for a member to a longer decimal value, Labrinth accepts the change, however any subsequent requests to members endpoint will fail due to cache failures:

GET /project/notargetafk/members

🔴 500 Internal Server Error

{"error":"database_error","description":"Database Error: Timeout when waiting for cache subscriber"}

Steps to reproduce

  1. Go to your project members list in Knossos.
  2. Set any member's monetization weight to a value like 0.001.
  3. Observe how Knossos takes time to refresh data only to error out about members non-response.
  4. Refresh your project page in Knossos to notice that it's no longer accessible.

Expected behavior

Either decimals shouldn't be accepted to begin with or they should be fully functional regardless the value.

Additional context

ICOM-2604

[!CAUTION] Do not attempt to reproduce this bug unless you know what you are doing! This bug renders your project page fully inaccessible to Knossos (Modrinth website) users. The only way to fix this issue is to manually call the API to PATCH the individual members of your project's team to correct their monetization weights.