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

Notification Comment details: show loading and error views #18062

Merged
merged 2 commits into from
Mar 3, 2022

Conversation

ScoutHarris
Copy link
Contributor

@ScoutHarris ScoutHarris commented Mar 1, 2022

Ref: #17790

When a comment is being loaded, a loading view is displayed. When loading a comment fails, an error view is displayed.

To test:

  • Start with a fresh install so no comments are cached.
  • Slow down your network connection.
  • Go to Notifications.
  • Select a Comment notification.
  • Verify:
    • The loading view appears.
    • The loading view is removed when the comment is loaded.
    • NOTE: the gap at the top of the view as noted on this PR is still present. This will be addressed later.
  • Navigate to other notifications via the buttons on the nav bar.
  • Verify:
    • The loading view appears.
    • The loading view is removed when the comment is loaded.
  • Implement the hack below to show the error view.
  • Select a Comment notification.
  • Verify the error view appears.

Hack to test the error view. In NotificationCommentDetailViewController:

  • Immediately return nil from loadCommentFromCache.
  • fetchComment - call completion(nil) in the success block instead of completion(comment).
loading error

Regression Notes

  1. Potential unintended areas of impact
    N/A. WIP.

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    N/A. WIP.

  3. What automated tests I added (or what prevented me from doing so)
    N/A. WIP.

PR submission checklist:

  • I have completed the Regression Notes.
  • I have considered adding unit tests for my changes.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 1, 2022

You can test the Jetpack changes on this Pull Request by downloading it from AppCenter here with build number: pr18062-50f817b. IPA is available here. If you need access to this, you can ask a maintainer to add you.

@ScoutHarris ScoutHarris requested a review from dvdchr March 1, 2022 21:51
@ScoutHarris ScoutHarris marked this pull request as ready for review March 1, 2022 21:51
@wpmobilebot
Copy link
Contributor

You can test the WordPress changes on this Pull Request by downloading it from AppCenter here with build number: pr18062-50f817b. IPA is available here. If you need access to this, you can ask a maintainer to add you.

Copy link
Contributor

@dvdchr dvdchr left a comment

Choose a reason for hiding this comment

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

Things are working as described. LGTM! :shipit:

I've found a regression that's unrelated to this PR, but thought to share here. So when you get a comment notification from a site that you don't have access to, the Notification Comment Detail shows an error view. In the previous Notification Comment Detail, it worked.

Here's the repro step:

  1. With a second account, create a comment on a publicly accessible WP.com site (preferably owned by your other account).
  2. Now switch to your primary account, and reply to your second account's comment. This should trigger a reply notification on the second account.
  3. Switch back to your second account in your WordPress app, and go to Notifications.
  4. Tap on the reply notification.
  5. Observe that the page displays an error.

I've taken a look, and this is most likely because loadComment expects a Blog instance from local storage – and since the second account doesn't have any roles, the app didn't fetch the site, causing the blog to be nil.

Maybe we can switch the parameter to blogID instead, and use restRemoteForSite:(NSNumber *)siteID instead of remoteForBlog:(Blog *)blog?

@ScoutHarris ScoutHarris merged commit 7117d1e into trunk Mar 3, 2022
@ScoutHarris ScoutHarris deleted the feature/17790-show_nrv branch March 3, 2022 19:07
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