Skip to content

Fix Stats crash when the blog is released before the view loads - #25971

Open
crazytonyli wants to merge 1 commit into
trunkfrom
bugfix/jetpack-ios-1khv-stats-nil-blog
Open

Fix Stats crash when the blog is released before the view loads#25971
crazytonyli wants to merge 1 commit into
trunkfrom
bugfix/jetpack-ios-1khv-stats-nil-blog

Conversation

@crazytonyli

@crazytonyli crazytonyli commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

`StatsViewController.blog` was a weak reference. Every entry point set it and
returned before `viewDidLoad` ran, so when nothing else retained the Core Data
object (for example a push cold launch opening a notification's stats), the
reference was nil by the time `initStats` called `syncBlog:`. Since 27.2 that
nil reached `existingObject(with:)` and threw `NSInvalidArgumentException`.

Make the property strong so the controller owns the blog for its lifetime, and
have `syncBlog:` report a nil blog through its failure block instead of
crashing.

Fixes JETPACK-IOS-1KHV.
@dangermattic

Copy link
Copy Markdown
Collaborator
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@crazytonyli
crazytonyli requested a review from jkmassel September 1, 2026 22:31
@crazytonyli crazytonyli added this to the 27.3 milestone Sep 1, 2026
@crazytonyli
crazytonyli marked this pull request as ready for review September 1, 2026 22:31
@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number34131
VersionPR #25971
Bundle IDorg.wordpress.alpha
Commit61e0266
Installation URL4bcufnvuol9kg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor
App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number34131
VersionPR #25971
Bundle IDcom.jetpack.alpha
Commit61e0266
Installation URL5bu2r3gh6tr6o
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot

Copy link
Copy Markdown
Contributor

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

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.

3 participants