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

Unexpected API responses from GET requests within the Gutenberg editor #21034

Open
geriux opened this issue Jul 8, 2024 · 1 comment
Open
Labels
Gutenberg Editing and display of Gutenberg blocks. [Type] Bug

Comments

@geriux
Copy link
Member

geriux commented Jul 8, 2024

This issue tracks the investigations for the previously reported issue.

A recent change in Gutenberg caused the editor to make a GET API call to the /themes endpoint on start. This was causing a bug in the editor for sites without Jetpack and the Gutenberg plugin enabled, leading to crashes.

We decided to disable making /themes calls from Gutenberg until this issue is resolved. The problem seems to be related to how we handle these calls on the React Native side in executeWPAPIRequest.

Expected behavior

The editor should be able to make this call since it's a core endpoint.

Actual behavior

The editor is unable to successfully make a GET request to the themes endpoint when opened on sites without Jetpack or the Gutenberg plugin enabled.

It returns a 401 error with the message: Sorry, you are not allowed to view the active theme., then it tries to get a new nonce and call the endpoint again but it still fails.

Steps to reproduce the behavior

Important

Use a self-hosted site without Jetpack or the Gutenberg plugin enabled.

  • Open the editor
  • Once the editor attempts to fetch the themes endpoint it stops working, you can edit or add new content.
Tested on Samsung Galaxy A23 5G, Android 14, JPAndroid / WPAndroid 25.1
@geriux geriux added [Type] Bug Gutenberg Editing and display of Gutenberg blocks. labels Jul 8, 2024
@dangermattic
Copy link
Collaborator

Thanks for reporting! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Gutenberg Editing and display of Gutenberg blocks. [Type] Bug
Projects
None yet
Development

No branches or pull requests

2 participants