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

MWPW-152455 added handling of "no placeholders" case for parsePlaceholders() #3007

Merged
merged 3 commits into from
Oct 22, 2024

Conversation

denlight
Copy link
Contributor

@denlight denlight commented Oct 3, 2024

  • added handling of "no placeholders" case for parsePlaceholders()

Resolves: MWPW-152455

QA Instructions: The before link has an error message the after link does not:
MEP Error parsing manifests: TypeError: undefined is not iterable (cannot read property Symbol(Symbol.iterator))

Test URLs:

Psi-check: https://mwpw-152455--milo--adobecom.hlx.page/?martech=off

@denlight denlight requested a review from a team as a code owner October 3, 2024 20:14
Copy link
Contributor

aem-code-sync bot commented Oct 3, 2024

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

Copy link
Contributor

aem-code-sync bot commented Oct 3, 2024

Page Scores Audits Google
📱 /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI
🖥️ /?martech=off PERFORMANCE A11Y SEO BEST PRACTICES SI FCP LCP TBT CLS PSI

Copy link

codecov bot commented Oct 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.34%. Comparing base (baea3ad) to head (f91ef15).
Report is 21 commits behind head on stage.

Additional details and impacted files
@@           Coverage Diff           @@
##            stage    #3007   +/-   ##
=======================================
  Coverage   96.34%   96.34%           
=======================================
  Files         243      243           
  Lines       55284    55286    +2     
=======================================
+ Hits        53261    53263    +2     
  Misses       2023     2023           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@denlight denlight changed the title added no placeholders case for parsePlaceholders() added handling of "no placeholders" case for parsePlaceholders() Oct 3, 2024
@@ -655,17 +655,19 @@ function parsePlaceholders(placeholders, config, selectedVariantName = '') {
'value',
'other',
];
const [val] = Object.entries(placeholders[0])
Copy link
Contributor Author

@denlight denlight Oct 7, 2024

Choose a reason for hiding this comment

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

it was breaking here, where it was trying to deconstruct an array that was found by find function. But when nothing was found const [val] would break because undefined is treated like an array

@denlight denlight requested a review from mokimo October 8, 2024 16:47
@vgoodric vgoodric changed the title added handling of "no placeholders" case for parsePlaceholders() MWPW-152455 added handling of "no placeholders" case for parsePlaceholders() Oct 15, 2024
Copy link
Contributor

@mokimo mokimo left a comment

Choose a reason for hiding this comment

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

seems like this breaks a commerce nala placeholder test, otherwise lgtm!

@vgoodric vgoodric added verified PR has been E2E tested by a reviewer Ready for Stage labels Oct 17, 2024
@milo-pr-merge milo-pr-merge bot merged commit 2ba175c into stage Oct 22, 2024
22 checks passed
@milo-pr-merge milo-pr-merge bot deleted the MWPW-152455 branch October 22, 2024 08:03
@milo-pr-merge milo-pr-merge bot mentioned this pull request Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready for Stage verified PR has been E2E tested by a reviewer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants