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

Core Data: Update storage usage for BlazeStore #14532

Merged
merged 13 commits into from
Dec 2, 2024

Conversation

itsmeichigo
Copy link
Contributor

Part of #14122

Description

This PR migrates the storage usage for BlazeStore:

  • Replaced the deprecated usage of writerDerivedStorage with performAndSave method to ensure write operations are put in the same writer queue.
  • Optimize fetch requests when upserting campaign list items by using a single fetch for all campaigns instead of separate requests for each.

Steps to reproduce

  • Log in to a store eligible for Blaze.
  • Navigate to Menu tab > Blaze.
  • If the store has existing campaigns, confirm that loading campaigns work with pagination.
  • Create a new campaign. Confirm that campaign objectives, targeted devices, languages, topics can be loaded successfully. Reopening these sections should show data immediately as they are cached in the storage.
  • Ensure that campaign creation succeeds.

Testing information

Tested on simulator iPhone 16 Pro iOS 18.1 and confirmed that:

  • Loading Blaze campaigns work correctly with pagination.
  • Loading campaign objectives, targeted devices, languages and topics works correctly.
  • Campaign creation succeeds as expected.

All existing unit tests in BlazeStoreTests should still pass.

Screenshots

N/A


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

Reviewer (or Author, in the case of optional code reviews):

Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on all devices (phone/tablet) and no regressions are added.

@itsmeichigo itsmeichigo added type: task An internally driven task. feature: Blaze Related to the integration of the Blaze ads platform labels Nov 27, 2024
@itsmeichigo itsmeichigo added this to the 21.3 milestone Nov 27, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Nov 27, 2024

WooCommerce iOS📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS WooCommerce iOS
Build Numberpr14532-bc1f44f
Version21.2
Bundle IDcom.automattic.alpha.woocommerce
Commitbc1f44f
App Center BuildWooCommerce - Prototype Builds #11887
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@selanthiraiyan selanthiraiyan self-assigned this Dec 2, 2024
Copy link
Contributor

@selanthiraiyan selanthiraiyan left a comment

Choose a reason for hiding this comment

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

Nice work, Huong!

The code LGTM and tests as expected. 🚀

Storage/Storage/Tools/StorageType+Extensions.swift Outdated Show resolved Hide resolved
@itsmeichigo itsmeichigo enabled auto-merge December 2, 2024 08:23
@itsmeichigo itsmeichigo merged commit a2ea6a7 into trunk Dec 2, 2024
13 of 14 checks passed
@itsmeichigo itsmeichigo deleted the task/14122-blazestore-update branch December 2, 2024 08:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: Blaze Related to the integration of the Blaze ads platform type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants