Closed sentry-io[bot] closed 2 years ago
@luxiaba
We do not expect users to always upload images larger than the sizes in AvatarSize
, that is why the current implementation is crashing.
Commit f631306 added a test for this corner case.
If the user uploaded image is smaller, this is the originally expected behavior:
Resize to cover 24x24, 48x48, and 73x73.
But do not generate for 128x128, 256x256, and 512x512.
Tests can be ran like this:
pytest -sx -vvv --cov=app tests/
Sorry again, I think I ve solved this problem by this commit. resize other sizes based on the max AvatarSize
. If the original size is larger than the this, otherwise use the original size as the base.
You can reproduce the issue with the latest test test_images_resize_avatar_1px
.
I added the full expected behavior in 195e6a7
As long as it can pass the test, it will be fine.
I've test latest commit and it's passed all testes.
I didn't know that released it in the prod in such a timely manner, and i can't observe the latest error message in time. I'm very sorry to bring you trouble.
It is OK. Not your fault, and this project was open-sourced without proper tests.
We need more tests that align with the current production requirements. :)
maybe i can open a PR that add Github CI, in which pre-commit and testing are integrated if you wish.
Yes, of course. Thanks a lot!
First CI run completed successfully!
Sentry Issue: REMOTE-1D