Skip to content

Conversation

@emilylaguna
Copy link
Contributor

Sentry crash: https://sentry.io/organizations/a8c/issues/2511522132/events/?project=1438083

To test:

Verify the crash

  1. Create a self hosted site that is not connected to Jetpack
  2. Go to the My Site view
  3. Tap the dropdown to view all your sites
  4. Tap the + button to add a site
  5. Tap Add Self Hosted
  6. Add your new site
  7. If the app doesn't crash:

Force the crash

  1. Open Blog.m
  2. Go to line: 449
  3. Change it to return @5.5
  4. This will force return an NSNumber
  5. Relaunch the app
  6. It should crash

Verify the fix

  1. Remove the forced crash
  2. Go to Blog.m
  3. Line 902
  4. Add a line above it for:
if([name isEqualToString:@"software_version"]){
    return @5.5;
}

This force returns an NSNumber for the software version
5. Relaunch the app
6. It should not crash

Regression Notes

  1. Potential unintended areas of impact
  • The BlogService calls [[blog version] floatValue]; since NSString implements this method this will not cause an issue.
  • hasRequiredWordPressVersion in Blog.m expects a string anyways
  1. What I did to test those areas of impact (or what existing automated tests I relied on)
    I did manual testing of that section.

  2. What automated tests I added (or what prevented me from doing so)
    None.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jul 16, 2021

You can trigger an installable build for these changes by visiting CircleCI here.

@peril-wordpress-mobile
Copy link

peril-wordpress-mobile bot commented Jul 16, 2021

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@mokagio
Copy link
Contributor

mokagio commented Jul 16, 2021

@chipsnyder @Gio2018 @leandroalonso 👋 folks! @emilylaguna was a legend in jumping onto this bugfix and ping me about it. I don't feel like I have too much context around this code to give a proper review, though, so I'm pinging you as per GitHub's suggestion. Feel free to bring more knowledgeable people in (blame GitHub if this ping is inappropriate 😝) Thanks!

For context the crash this PR fixes is something that is a new one in 17.7 and it's slowly but steadily rising in occurrences.

@mokagio
Copy link
Contributor

mokagio commented Jul 16, 2021

@emilylaguna just dropping a note here in case something happens and I'm not able to followup: if we decide to proceed with the hotfix (as opposed to assess the occurrence of this issue "minor" and target the upcoming release instead) hotfix/17.7.1 is not the best place to merge this PR into.

A release manager, ideally me unless this escalates and I'm offline, will create a new hotfix release branch using the new_hotfix_release lane and take care of merging into it and shipping.

I had time to start the hotfix process and changed the base for this PR to release/17.7.1. Please note that whether this should be an hotfix is yet to be decided. I did all this to get ahead just in case we make that call.

@mokagio mokagio changed the base branch from hotfix/17.7.1 to release/17.7.1 July 16, 2021 06:36
@leandroalonso
Copy link
Contributor

Reviewing it 👀

Copy link
Contributor

@leandroalonso leandroalonso left a comment

Choose a reason for hiding this comment

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

I wasn't able to trigger the crash by adding a self-hosted site.

But following the test steps and playing with the value I was able to check correctness.

@emilylaguna this is a good opportunity to add unit tests for this change, ensuring that it works as expected and preventing any regression in the future. :)

@emilylaguna
Copy link
Contributor Author

@leandroalonso good point! I'm adding tests now.

@emilylaguna
Copy link
Contributor Author

@leandroalonso tests added: ea8b3e3

@emilylaguna
Copy link
Contributor Author

@leandroalonso updated tests to include a test covering the "else" case: 741d128

@leandroalonso
Copy link
Contributor

@emilylaguna 👌

@emilylaguna
Copy link
Contributor Author

🥳 Will merge once build tests finish.

@emilylaguna emilylaguna merged commit cde9449 into release/17.7.1 Jul 16, 2021
@emilylaguna emilylaguna deleted the issue/fix-swift-version-crash branch July 16, 2021 17:15
set(blogOption: "jetpack_user_email", value: email)
set(blogOption: "jetpack_version", value: version as Any)
set(blogOption: "jetpack_user_login", value: username as Any)
set(blogOption: "jetpack_user_email", value: email as Any)
Copy link
Contributor

Choose a reason for hiding this comment

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

@emilylaguna I noticed these typecast while looking over #16883.

I'm curious to know what made them necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, Xcode 12.5 was complaining about them.

Screen Shot 2021-07-20 at 9 09 40 AM

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants