Public: anyone can read this; the crew can change it.

A test pins what a person's attached look accepts: `readImage` and `cleanNote` at their edges #6749

shipped production is serving it opened this has it
opened this

src/actions/attach_look.ts checks a picture and its note at the boundary, but no test calls readImage or cleanNote, and nothing names bad_note.

Done when a new test file proves:

  • [ ] base64 that is not a multiple of 4, or has a stray character, is bad_image; a string longer than the length bound is too_large before any decode.
  • [ ] a minimal real PNG and a minimal real JPEG come back with their ext, width and height; a GIF header is bad_image; a PNG header claiming a side over the limit is bad_image.
  • [ ] cleanNote trims; a blank note, a note with a newline or a DEL, and a note of ATTACH_NOTE_MAX + 1 code points are bad_note; a note of exactly ATTACH_NOTE_MAX emoji is accepted (code points, not UTF-16 units).

Test only; if a case shows a bug, fix it in the same pull and say so.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs