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: Migrate storage usage in SettingStore #14569

Open
wants to merge 4 commits into
base: trunk
Choose a base branch
from

Conversation

itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Dec 2, 2024

Part of #14122

Description

This PR updates the storage usage in SettingStore:

  • Replace the deprecated usage of writerDerivedStorage with the new method performAndSave to ensure write operations are handled in the same operation queue.
  • Optimize fetch requests when upserting settings.

Steps to reproduce

Site settings are used in various features in the app, the most straightforward place to test would be the Product AI feature:

  • Log out of the app to ensure that settings are cleared from the local storage.
  • Log in to a test store that is Jetpack-connected with Jetpack plugin.
  • Navigate to the Products tab > select + > Add product with AI.
  • Enter a name or package photo for a physical product and proceed.
  • Confirm that AI can generate product details with correct units for weight and dimensions.

Testing information

Tested on simulator iPhone 16 Pro iOS 18.1 and confirmed that features that require app settings like product creation AI, product details, and order details work as expected.

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: app settings Related to settings accessed via the gear icon in the My Store section. labels Dec 2, 2024
@itsmeichigo itsmeichigo added this to the 21.3 milestone Dec 2, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Dec 2, 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 Numberpr14569-934e032
Version21.2
Bundle IDcom.automattic.alpha.woocommerce
Commit934e032
App Center BuildWooCommerce - Prototype Builds #11925
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@itsmeichigo itsmeichigo marked this pull request as ready for review December 3, 2024 03:28
@hichamboushaba hichamboushaba self-assigned this Dec 3, 2024
Copy link
Member

@hichamboushaba hichamboushaba 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 @itsmeichigo, code looks good, and works as expected, tested using iPhone 16 simulator, and confirmed that the site settings are also refreshed on app launch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: app settings Related to settings accessed via the gear icon in the My Store section. type: task An internally driven task.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants