-
Notifications
You must be signed in to change notification settings - Fork 120
Fix crash on order details when sections are updated #15633
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 crash on order details when sections are updated #15633
Conversation
| func reloadTableViewSectionsAndData() { | ||
| configureNavigationBar() | ||
| reloadSections() | ||
| reloadTableViewDataIfPossible() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant as the reloadSections method in the datasource already triggers a reload.
|
|
jaclync
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crash that I could repro after a full refund on web in trunk no longer happens now
thanks for fixing this!
Just wondering, since this isViewLoaded check has been around since 2018, do we know what might have changed that causes this likely recent crash? Like some new calls when isViewLoaded == true?
|
Sidenote: my test site doesn't have any shipping plugins, just WooCommerce. |
|
Thanks @jaclync for the review!
With many moving pieces on the order details screen over the years, I have no good answer to this. My wild guess is that the introduction of the split view might have something to do with this, as there have been significant changes to the hierarchy of the Orders tab. But I'm not 100% sure - we would need to test again with a pre-split view build to confirm that.
My understanding is that the order item section goes through the most changes when an order status is changed to refunded, so that could possibly be a reason for the crash when reloading the table view. I'm merging the PR for now. |

Closes WOOMOB-482
Description
This PR fixes a crash when the order details screen cannot reload after its sections are updated. Steps to reproduce:
The crash was due to a check for
isViewLoadedand the table view reloading is skipped if the view is not yet loaded into memory. This check is from a legacy commit from long ago that is now redundant. Removing the check enables the table to load properly when needed.Testing instructions
Testing information
Tested following the steps above on simulator iPhone 16 Pro iOS 18.2 and confirmed that the app no longer crashes.
Also did some smoke testing on the order details screen and confirmed that the screen loads correctly for orders of different statuses.
Screenshots
Screen.Recording.2025-05-14.at.15.52.28.mov
RELEASE-NOTES.txtif 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: