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

Fix Crash in BottomSheetViewController due to Incorrect Selector Usage #128

Merged
merged 4 commits into from
Jul 19, 2023

Conversation

pmusolino
Copy link
Member

This PR addresses a crash in the BottomSheetViewController that was occurring due to incorrect usage of a selector. The crash was caused by trying to call the buttonPressed instance method as a class method on BottomSheetViewController.self.

Changes:

  • Changed var to lazy var for gripButton to delay its initialization until it's first used.
  • Replaced BottomSheetViewController.self with self in addTarget method to correctly call buttonPressed on the current instance of BottomSheetViewController.

These changes fix the crash and ensure that the buttonPressed method is correctly called when the gripButton is pressed. The dismiss functionality of the bottom sheet should now work as expected.

Testing:


  • I have considered if this change warrants release notes and have added them to the appropriate section in the CHANGELOG.md if necessary.

…ng due to an incorrect usage of a selector. The crash was caused by trying to call the `buttonPressed` instance method as a class method on `BottomSheetViewController.self`.
@pmusolino pmusolino added the bug Something isn't working label Jul 18, 2023
Copy link

@itsmeichigo itsmeichigo left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this bug! I added some comments regarding the versioning of the bug fix.

@@ -48,6 +48,12 @@ _None._

_None._

## 1.13.1

Choose a reason for hiding this comment

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

Nit: Last time I checked, any fixes or updates to libraries should be set with a beta version, and release managers will take care of releasing a new version. So here we should use 1.13.1-beta-1 instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

FWIW, there is no need to update the version header in the CHANGELOG while in development. The release manager that will ship the next stable version will do that.

This is advantageous because it allows all different kind of changes to land in the main branch and for the semantic version value to be evaluated only at the time of cutting a new stable version.

Example: If only bug fixes landed, we shall make the new version a patch. But if a new feature landed as well as bug fixes, it should be a new minor version.

CHANGELOG.md Outdated
@@ -48,6 +48,12 @@ _None._

_None._

## 1.13.1

### New Features

Choose a reason for hiding this comment

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

Nit: This is a bug fix, so please note it with Bug Fixes instead.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -2,7 +2,7 @@

Pod::Spec.new do |s|
s.name = 'WordPressUI'
s.version = '1.13.0'
s.version = '1.13.1'

Choose a reason for hiding this comment

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

Similar as above, this fix should be tagged 1.13.1-beta.

Copy link
Contributor

@mokagio mokagio Jul 19, 2023

Choose a reason for hiding this comment

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

If it's convenient for the WooCommerce release schedule, we can bypass the beta step and ship a new stable version straightaway.

If, however, you'd rather ship a beta first, then this should be 1.31.1-beta.1

Let me know.

Choose a reason for hiding this comment

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

I don't have a strong opinion about this, so I'll leave the question to @pmusolino.

Copy link
Member Author

Choose a reason for hiding this comment

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

It would be beneficial to circumvent the beta phase, as the absence of this particular fix results in an app crash. @mokagio 🙌

@itsmeichigo itsmeichigo self-assigned this Jul 19, 2023
@pmusolino
Copy link
Member Author

@mokagio could I proceed with the merge? Is there anything missing? 🙇

@mokagio mokagio merged commit b9476a2 into trunk Jul 19, 2023
@mokagio mokagio deleted the task/fix-crash-BottomSheetViewController branch July 19, 2023 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants