Skip to content

Conversation

@itsmeichigo
Copy link
Contributor

@itsmeichigo itsmeichigo commented Nov 13, 2025

Description

In #16339 @RafaelKayumov noticed that the results controller was not updated immediately when its predicate and sort descriptors are updated. The list is only updated after syncing finishes.

The reason is that when performFetch is triggered directly after changing predicate and sort descriptors, NSFetchedResultsController does NOT automatically call its delegate methods. The delegate methods are only triggered when the underlying Core Data store changes, not upon manual refetching.

This PR fixes the issue by manually triggering onDidChangeContent at the end of refreshFetchedObjects methods in GenericResultsController.

Test Steps

  1. Comment out line 123 to prevent the resyncing of data in BookingListViewModel when switching filters.
  2. Build and run the app.
  3. Log in to a CIAB store with existing bookings.
  4. Navigate to Bookings tab > All > Filters.
  5. Select any filter option and select Show bookings.
  6. Confirm that the booking list is reloaded immediately matching the new filters.
  7. Repeat the test by tapping Sort and select a different sort option.
  8. Confirm that the booking list is reloaded immediately matching the new sort option.

For beta testers, you can also disconnect the Internet connection on your devices and do similar tests as above using the order list or product list.

Screenshots

Simulator.Screen.Recording.-.iPhone.17.-.2025-11-13.at.09.58.37.mov

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

@itsmeichigo itsmeichigo added this to the 23.7 milestone Nov 13, 2025
@dangermattic
Copy link
Collaborator

dangermattic commented Nov 13, 2025

1 Warning
⚠️ This PR is assigned to the milestone 23.7. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

Base automatically changed from woomob-1650-update-filtering-for-statuses to trunk November 13, 2025 03:02
@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 Numberpr16350-87e48a7
Version23.6
Bundle IDcom.automattic.alpha.woocommerce
Commit87e48a7
Installation URL19dua8fe4an68
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@itsmeichigo itsmeichigo marked this pull request as ready for review November 13, 2025 03:28
Copy link
Contributor

@RafaelKayumov RafaelKayumov left a comment

Choose a reason for hiding this comment

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

LGTM. Thx for the fix.

@itsmeichigo itsmeichigo merged commit f029712 into trunk Nov 14, 2025
17 checks passed
@itsmeichigo itsmeichigo deleted the fix/results-controller-refresh branch November 14, 2025 02:03
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.

5 participants