Skip to content

Conversation

kean
Copy link
Contributor

@kean kean commented Oct 14, 2025

@kean kean added this to the 26.5 milestone Oct 14, 2025
@kean kean added the General label Oct 14, 2025
@kean kean requested a review from crazytonyli October 14, 2025 13:19
@kean kean force-pushed the fix/crash-on-launch branch from a26a530 to 8aea6df Compare October 14, 2025 13:21
@kean kean enabled auto-merge October 14, 2025 13:21
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 14, 2025

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 Number29500
VersionPR #24944
Bundle IDorg.wordpress.alpha
Commitf95cdd9
Installation URL1boonithf4g08
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Oct 14, 2025

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 Number29500
VersionPR #24944
Bundle IDcom.jetpack.alpha
Commitf95cdd9
Installation URL4g55uke8jst88
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

Copy link

Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

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

Can we find out why WordPressOrgRestApi might not be initializable? There shouldn't be any blogs on the device that don't work with this, so if there are we should figure out why – we probably have the data we need, we're just not getting it in the right way.

@kean
Copy link
Contributor Author

kean commented Oct 15, 2025

It looks like it's normal situation for the init to return nil as it requires authorization to be present. For Dotcom blog, the token can be nil if it's invalidated by the server. For Dotorg blogs, it's a bit more complicated – any of these five fields can be missing. I'm not familiar with this code, but it seems reasonable from the first glance.

Regardless of the reason it returns nil, the code in this PR should not force-unwrap it and should fail gracefully. Presumably, there is another part of system that will handle the missing authorization or other missing fields.

The crash only affected one user: https://a8c.sentry.io/issues/6942573624/events/?project=5716771. It's like a self-hosted site due to the missing "user" field.

@jkmassel
Copy link
Contributor

Could we have RawBlockEditorSettingsService take WordPressOrgRestApi as a non-optional initializer then?

That way we can at least make it so that class doesn't need special error handling?

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants