vigour-io/shutter

Multi-image responses sometimes break

Closed this issue · 4 comments

Sometimes, response chunks can be so small they don't hold the entire destination of a file. Let's add a separator suffix to make sure we have the full path every time

Suffix added. Still breaks sometimes. Instead of seeing paths with missing endings, I now see paths with missing beginnings... See new text in vigour-native (https://github.com/vigour-io/vigour-native/blob/develop/test/node/tasks/nativeassets.js)

Also, this behaviour only seems to occur when reaching the remote image server (img.vigour.io), not when reaching a local server, even though they are running the same version.

Fixed by 5c15abd

Just got this error again. This can still happen when a separator prefix or suffix doesn't arrive in a single chunk. I need to redo this whole separator detection algorithm in a more bullet-proof way.

Well, it seems I had lots to learn about chunks and buffers. However this is finally fixed in 33d1053 (the fixed has then been cleaned up in df44378). It would be possible to clean this up further to avoid a little bit of code duplication, but it's so small and has taken so much time already that I'm just going to leave it for now and close this issue.