Page MenuHomePhabricator

[Cashtab + token-server] Bump icon upload size and validate icon size before token creation
ClosedPublic

Authored by bytesofman on Apr 25 2024, 22:17.

Details

Summary

Cashtab already resizes icons before upload to 512x512. In practice, it is hard to get an icon over 1,000,000 bytes. But, it is pretty easy to get one over 500,000 bytes, esp if the square shape is selected.

Bump the limit to 1,000,000 bytes (which is unexpected to be hit by Cashtab). Add validation to Cashtab to disable token creation if the server is expected to reject the icon.

Test Plan

npm test

I was not able to test this directly with these limits, as Cashtab always resized even large images to below 1,000,000 bytes. But, you can verify the button disables and the disabled msg appears by changing the value of ICON_MAX_UPLOAD_BYTES to, say, 100. Then add an icon and see the error msg.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable