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

🤖 Add Active Model Serializers and Update Product Serialization #655

Conversation

sentry-autofix[bot]
Copy link
Contributor

@sentry-autofix sentry-autofix bot commented Jan 7, 2025

👋 Hi there! This PR was automatically generated by Autofix 🤖

This fix was triggered by Kosty Maleyev

Fixes REACT-594

This pull request introduces the 'active_model_serializers' gem to enhance JSON response handling for product data. In the Products controller, the serialization of product data has been modified to eagerly load reviews to optimize database queries and utilize the ProductSerializer for consistent JSON formatting of product attributes and related reviews. Additionally, changes in the React component ensure a safe access to reviews by validating if it is an array before processing, effectively guarding against potential errors due to unexpected data structure.

If you have any questions or feedback for the Sentry team about this fix, please email [email protected] with the Run ID: 2974.

Copy link

vercel bot commented Jan 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
empower ⬜️ Ignored (Inspect) Visit Preview Jan 7, 2025 10:54pm

Copy link

codecov bot commented Jan 7, 2025

Bundle Report

Changes will increase total bundle size by 1.42MB (100.0%) ⬆️⚠️, exceeding the configured threshold of 5%.

Bundle name Size Change
empower-react-app-array-push 1.42MB 1.42MB (100%) ⬆️⚠️

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

Attention: Patch coverage is 50.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 34.12%. Comparing base (e8a7cc2) to head (07f56a9).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
react/src/components/Products.jsx 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #655      +/-   ##
==========================================
- Coverage   34.13%   34.12%   -0.01%     
==========================================
  Files          37       37              
  Lines         920      923       +3     
  Branches      111      114       +3     
==========================================
+ Hits          314      315       +1     
- Misses        589      590       +1     
- Partials       17       18       +1     
Flag Coverage Δ
api 6.59% <ø> (ø)
frontend 54.63% <50.00%> (-0.13%) ⬇️
Components Coverage Δ
checkout_module 6.59% <ø> (ø)
product_component 56.19% <50.00%> (-0.22%) ⬇️
Files with missing lines Coverage Δ
react/src/components/Products.jsx 87.14% <50.00%> (-2.41%) ⬇️

@realkosty realkosty marked this pull request as ready for review January 7, 2025 22:57
@realkosty realkosty requested a review from ndmanvar as a code owner January 7, 2025 22:57
@realkosty realkosty merged commit d6c1a96 into master Jan 7, 2025
18 of 19 checks passed
@realkosty realkosty deleted the autofix/add-active-model-serializers-and-update-product-serialization branch January 7, 2025 22:57
realkosty added a commit that referenced this pull request Jan 9, 2025
* [react, rails] rollback some unnecessary changes in autofix-generate PR #655

* [rails] Revert all previous attemtpts

* [rails] fix reviews serialization after Postgres upgrade
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