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: only apply merging to plain objects #3503

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

jaredrethman
Copy link
Collaborator

@jaredrethman jaredrethman commented Oct 25, 2024

All Submissions:

Changes proposed in this Pull Request:

When merging caches using updateCacheKey the logic assumes all values are plain objects. This is causing Array cache types being converted to objects.

Example:

['one', 'two']
// is becoming
{"0":"one", "1": "two"}

This PR aims to fix this.

How to test the changes in this Pull Request:

  1. Checkout and build assets git checkout origin/fix/wizardapifetch-cache-merging && npm run build.
  2. Navigate to /wp-admin/admin.php?page=newspack-settings
  3. Scroll down to "Webhook Endpoints" and add, edit and delete Endpoints and confirm changes reflect between tab changes and page refreshes.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

@jaredrethman jaredrethman marked this pull request as ready for review October 25, 2024 20:36
@jaredrethman jaredrethman requested a review from a team as a code owner October 25, 2024 20:36
@jaredrethman jaredrethman added the [Status] Needs Review The issue or pull request needs to be reviewed label Oct 25, 2024
Copy link
Member

@miguelpeixe miguelpeixe left a comment

Choose a reason for hiding this comment

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

Fixes the issue!

@github-actions github-actions bot added [Status] Approved The pull request has been reviewed and is ready to merge and removed [Status] Needs Review The issue or pull request needs to be reviewed labels Oct 28, 2024
@jaredrethman jaredrethman merged commit d2dc24b into epic/ia Oct 28, 2024
9 checks passed
@jaredrethman jaredrethman deleted the fix/wizardapifetch-cache-merging branch October 28, 2024 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Status] Approved The pull request has been reviewed and is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants