Web-stories-wp: Dashboard: "Unable to load stories" error shows even when I have stories

Created on 2 Jul 2020  路  8Comments  路  Source: google/web-stories-wp

Bug Description

When I navigate to the Stories page in the WP Admin with one Draft story created, I am greeted with an "Unable to load stories" error toast notification.

Initial load of the page shows the error and toggling between All/Drafts/Published each trigger the error again.

Expected Behaviour

I would expect not to see "Unable to load stories" errors if my stories are loaded to the page. If an actual error of some sort did occur, the error message is unclear because I have a story in the view, but the error says it was unable to load the stories.

Steps to Reproduce

  • Create one story.
  • Leave it as a draft.
  • Visit the "Stories" page from the main WordPress Admin navigation menu

Screenshots

amp-stories-loading-error

Additional Context

Slick plugin! Really like how ya'll are using Gutenberg components to create a familiar but unique editing experience! Really cool!

Hope this info helps.

  • Plugin Version: 1.0.0-beta.1
  • WordPress Version: 5.4.2

I did checkout the network tab to investigate. It looks like it made a request to this URL:

http://acf2.local/wp-json/wp/v2/web-story?context=edit&order=desc&orderby=modified&page=NaN&per_page=24&status=draft&_locale=user

That returns a 400 with the following response body:

{ 
  "code":"rest_invalid_param",
  "message":"Invalid parameter(s): page",
  "data":{
    "status":400,
    "params":{
      "page":"page is not of type integer."
    }
  }
}

_Do not alter or remove anything below. The following sections will be managed by moderators only._

Acceptance Criteria

Implementation Brief

Dashboard Not Applicable Support

Most helpful comment

After debugging in Slack with @swissspidy, we determined there was a conflict with the WPGraphQL JWT Authentication plugin.

I'll open an issue on that repo to resolve the conflict over there.

Thanks for your time @swissspidy! And congrats to the whole team on a great product. Lots of inspiring details.

All 8 comments

Hey Jason,

thanks a lot for your super thorough report and kind words!

We'll look into it as soon as possible. While I cannot reproduce it myself right now, preventing things like page=NaN should hopefully bee an easy thing to address.


Really like how ya'll are using Gutenberg components to create a familiar but unique editing experience

Besides some packages like @wordpress/api-fetch we actually don't use any Gutenberg components or the like - it's all custom :-) We'll definitely share more about the how & why in the future.

@jasonbahl While we鈥榬e working on a potential fix in #2952, could you perhaps give this ZIP with the applied change a try? https://github.com/google/web-stories-wp/suites/870754629/artifacts/10121126

@jasonbahl Friendly ping :-)

@swissspidy thanks for the ping. I will try again shortly and report back.

@swissspidy no change in behavior. Network requests still going to: http://acf2.local/wp-json/wp/v2/web-story?context=edit&order=desc&orderby=modified&page=NaN&per_page=24&status=publish%2Cdraft&_locale=user and returning a 401 status

happy to hop on a screen share if that's beneficial

@jasonbahl Yeah, that might be easiest. Let's chat on WordPress Slack or something to get to the bottom of this.

After debugging in Slack with @swissspidy, we determined there was a conflict with the WPGraphQL JWT Authentication plugin.

I'll open an issue on that repo to resolve the conflict over there.

Thanks for your time @swissspidy! And congrats to the whole team on a great product. Lots of inspiring details.

Was this page helpful?
0 / 5 - 0 ratings