Skip to content

Conversation

@joshheald
Copy link
Contributor

Description

This PR improves some theoretical issues with sync eligibility checking. I've not been able to really recreate these, but you probably could if you left an iPad in kiosk mode for a month or more.

We determine time-based sync eligibility based on:

  • Has the POS ever synced? If not, assume eligible.
  • Has it been 30 days since the POS first synced? If less, assume eligible.
  • Has the user opened POS in the last 30 days? Eligible if true, ineligible if false.

These criteria are designed for syncs which are performed when POS isn't in use… if someone's actively using POS, they don't make sense.

To fix it, we can just ignore the time-based sync eligibility criteria when POS is actually in use. I achieved this by checking for a max catalog age of zero in a refresh. When that's true, we’re forcing a sync – e.g. because of a pull to refresh, or a full sync from settings, or after a purchase.

When we do this, we should ignore temporal reasons for not syncing. Otherwise, it’s possible to get into a position where syncs don’t work any more even though they should.

Test Steps

  • Replace .day with .second in all instances in POSCatalogSyncCoordinator
  • Launch the app and open POS
  • Pull to refresh
  • Observe that the sync completes and the following is logged:
📋 POSCatalogSyncCoordinator: Site 216335538 eligible (ignored temporal criteria check)

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

When we set a max catalog age of zero in a refresh, we’re forcing a sync – e.g. because of a pull to refresh, or a full sync from settings, or after a purchase.

When we do this, we should ignore temporal reasons for not syncing. Otherwise, it’s possible to get into a position where syncs don’t work any more even though they should.
@joshheald joshheald added this to the 23.9 milestone Dec 2, 2025
@joshheald joshheald added type: bug A confirmed bug. feature: POS labels Dec 2, 2025
@wpmobilebot
Copy link
Collaborator

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

App NameWooCommerce iOS Prototype
Build Numberpr16423-f062cb2
Version23.8
Bundle IDcom.automattic.alpha.woocommerce
Commitf062cb2
Installation URL47kb1ahulr9mo
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants