Blogging Prompt Dashboard Card: show error when fetching prompt fails - #18548
Conversation
wargcm
left a comment
There was a problem hiding this comment.
Code looks good! I just have one question and a note.
-
Should the pull to refresh on the dashboard trigger the fetch prompts call?
-
I think that behavior I noted in your other PR (#18534 (comment)) can cause the card to get into a weird state. In portrait, it can have an error state but in landscape, it shows the prompt:
error-portrait-landscape.mp4
|
Thanks for the feedback @wargcm .
I assume so. However, it appears none of the cards are updated. Maybe @leandroalonso can help. I could be wrong, but it looks like pull to refresh updates the list of cards, not the cards themselves.
I don't know how you forced the failure, but I couldn't repro that state. However, I did notice that I forgot to set |
I turned off my internet on the initial load, turned it back on, and then went into landscape. |
I haven't looked deep into that but the collection view that displays the cards is powered by a diffable data source (you can check When updating the cards, the OS looks at every Maybe that's why the card is not updating? |
You can test the changes in Jetpack from this Pull Request by:
|
You can test the changes in WordPress from this Pull Request by:
|
|
Thanks @leandroalonso ! I missed that whole snapshot business. 😄 @wargcm since that has nothing to do with this PR, it can be investigated separately. |
Thanks for the info. My latest changes seems to have fixed it, so I'm calling it good. |
Ref: #18429, #18534 (comment)
When obtaining a prompt fails, an error message is now displayed on the dashboard prompt card.
To test:
BloggingPromptsService.fetchTodaysPrompt, callfailure(nil)in the success block.Blogging Promptsfeature.Regression Notes
Potential unintended areas of impact
N/A
What I did to test those areas of impact (or what existing automated tests I relied on)
N/A
What automated tests I added (or what prevented me from doing so)
N/A
PR submission checklist:
RELEASE-NOTES.txtif necessary.