Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/api-issue #68

Merged
merged 5 commits into from
Oct 20, 2023
Merged

Fix/api-issue #68

merged 5 commits into from
Oct 20, 2023

Conversation

capetillo
Copy link
Contributor

@capetillo capetillo commented Oct 20, 2023

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 was SMARTSTK and SSTKNUM to be able to group images.

Implementation:

With the extensive help of @mgdaily, we created a variable called header_dictionary that parses header into a dictionary. This way, we can more cleanly get SMARTSTK and SSTKNUM from the header_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 preventing 413 errors\

You can see the UI PR related to this issue here.

@capetillo capetillo requested a review from mgdaily October 20, 2023 18:22
Copy link
Contributor

@mgdaily mgdaily left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@capetillo capetillo merged commit c0bdc0c into main Oct 20, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants