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 error #112

Merged
merged 2 commits into from
Oct 20, 2023
Merged

Fix/api error #112

merged 2 commits into from
Oct 20, 2023

Conversation

capetillo
Copy link
Contributor

@capetillo capetillo commented Oct 20, 2023

FIX: Images not appearing

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 a 413 error 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. The frontend issue was that images were not loading due to the backend.

Implementation:

After fixing the backend here, all I had to do was change how SMARTSTK and SSTKNUM were obtained. In recent_images_condensed instead of checking for cur.header.SMARTSTK or cur.header.SSTKNUM, I simply checked for cur.SMARTSTK and cur.SSTKNUM because now these keys were a part of the cur object rather than keys inside the header object. I followed this structure throughout the code wherever header was referenced.

VISUALS

Internal server error
Screenshot 2023-10-17 at 4 20 32 PM

No images loading in eco2 site before fix
image

Images loading in eco2 after fix
Screenshot 2023-10-20 at 11 21 24 AM

Carolina Capetillo added 2 commits October 19, 2023 17:29
…um to group images because we've now changed the backend to only send these values rather than the entire header object
@capetillo capetillo requested a review from mgdaily October 20, 2023 18:22
@capetillo capetillo merged commit 5e9a89f into dev Oct 20, 2023
1 check passed
@capetillo capetillo deleted the fix/api-error branch October 20, 2023 21:13
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.

1 participant