Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
FIX: Not sending entire image header to backend
DESCRIPTION
Background:
Occasionally, images at certain sites wouldn't load and the user could only see the placeholder image. This issue was raised by Michael here. After investigating CloudWatch with @mgdaily, we found that the api request was returning
413 errors
because there was too much data to return. The problem here was that we were sending the entire image header to the backend when really, all we needed from the header wasSMARTSTK
andSSTKNUM
to be able to group images.Implementation:
With the extensive help of @mgdaily, we created a variable called
header_dictionary
that parsesheader
into a dictionary. This way, we can more cleanlyget
SMARTSTK
andSSTKNUM
from theheader_dictionary
. We also added existence and safety checks to prevent errors. By only returning these two values rather than the entire header object, we're significantly reducing the amount of data that we send and return, presumably preventing413 errors
\You can see the UI PR related to this issue here.