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

Enhance error logging in OrderDetailsDataSource #14018

Merged

Conversation

pmusolino
Copy link
Member

Part of #13853

Description

This update enhances the error logging within the OrderDetailsDataSource class to improve crash diagnostics. The changes ensure that invalid indices and sections are logged for better debugging and error tracking.

Summary of changes

  • Add crash logging for invalid shippingLabelIndex.
  • Add crash logging for invalid row index for shippingLabel.
  • Add crash logging for invalid section in numberOfRowsInSection.
  • Add crash logging for invalid section and row in cellForRowAtIndexPath.
  • Add crash logging for invalid section in viewForHeaderInSection.
  • Update RELEASE-NOTES.txt to reflect the new changes and enhancements.

Steps to reproduce

  • Verify that the application logs appropriate error messages when invalid indices or sections are encountered in the OrderDetailsDataSource class. However, this could be complicated, as we have rarely if ever been able to replicate this crash.

Testing information

Please, smoke testing the Order Detail section to make sure everything works like before.


  • 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.

- Add crash logging for invalid shippingLabelIndex in OrderDetailsDataSource.swift
- Add crash logging for invalid row index for shippingLabel in OrderDetailsDataSource.swift
- Add crash logging for invalid section in numberOfRowsInSection in OrderDetailsDataSource.swift
- Add crash logging for invalid section and row in cellForRowAtIndexPath in OrderDetailsDataSource.swift
- Add crash logging for invalid section in viewForHeaderInSection in OrderDetailsDataSource.swift
@pmusolino pmusolino added this to the 20.6 milestone Sep 23, 2024
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Sep 23, 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 Numberpr14018-0414c05
Version20.5
Bundle IDcom.automattic.alpha.woocommerce
Commit0414c05
App Center BuildWooCommerce - Prototype Builds #11024
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@hafizrahman hafizrahman self-assigned this Sep 26, 2024
Copy link
Contributor

@hafizrahman hafizrahman left a comment

Choose a reason for hiding this comment

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

Given that I can't trigger the issues in the Simulator or real device, I:

  • checked the code
  • tested Order Details's features.

All good as far as I can check.

Found an unrelated UI issue, reported in:

#14049

@pmusolino pmusolino enabled auto-merge September 26, 2024 10:16
@wpmobilebot wpmobilebot modified the milestones: 20.6, 20.7 Sep 27, 2024
@wpmobilebot
Copy link
Collaborator

Version 20.6 has now entered code-freeze, so the milestone of this PR has been updated to 20.7.

@pmusolino pmusolino merged commit aa20c96 into trunk Sep 27, 2024
15 of 16 checks passed
@pmusolino pmusolino deleted the issue/13853-order-crash-createPreparedCellForGlobalRow branch September 27, 2024 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: order details Related to order details.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants