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

Refactor NotificationsViewController & Add NotificationsViewModel #22351

Merged
merged 10 commits into from
Jan 30, 2024

Conversation

alpavanoglu
Copy link
Contributor

@alpavanoglu alpavanoglu commented Jan 9, 2024

Refs: pcdRpT-5aB-p2

This PR is a first of a following chain to reduce the complexity of NotificationsViewController by attempting to decouple logic from the view. So we can add and modify features quickly in our next project.

I will isolate the changes semantically to make testing and reviewing easier. So all the changes here are about lastSeen logic.

Testing Steps

  1. Install & Login to Jetpack app.
  2. App badges must be enabled. Check current badge count.
  3. Navigate to Notifications
  4. ✅ Check if viewing the Notifications updates the badges as it should.

Regression Notes

  1. Potential unintended areas of impact
    The refactored areas themselves

  2. What I did to test those areas of impact (or what existing automated tests I relied on)
    Unit tests added.

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

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.

@salimbraksa salimbraksa self-requested a review January 12, 2024 16:45
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 16, 2024

WordPress Alpha📲 You can test the changes from this Pull Request in WordPress Alpha by scanning the QR code below to install the corresponding build.
App NameWordPress Alpha WordPress Alpha
ConfigurationRelease-Alpha
Build Numberpr22351-15a74fe
Version24.1
Bundle IDorg.wordpress.alpha
Commit15a74fe
App Center BuildWPiOS - One-Offs #8595
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Jan 16, 2024

Jetpack Alpha📲 You can test the changes from this Pull Request in Jetpack Alpha by scanning the QR code below to install the corresponding build.
App NameJetpack Alpha Jetpack Alpha
ConfigurationRelease-Alpha
Build Numberpr22351-15a74fe
Version24.1
Bundle IDcom.jetpack.alpha
Commit15a74fe
App Center Buildjetpack-installable-builds #7624
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

@salimbraksa
Copy link
Contributor

@alpavanoglu Code changes look good to me, but I wasn't able to test the changes. The App Badges is always 0, this is not a regression, it was always the case for me. Perhaps @hassaanelgarem can help test the PR?

N.B. I made sure App Badges is enabled.

@mokagio
Copy link
Contributor

mokagio commented Jan 22, 2024

I'm going to bump this to the next release because we'll be code freezing 24.1 today and this hasn't been reviewed yet.

If these changes cannot wait two weeks and it's important that it makes it into this release, let me know and we'll organize a new beta once ready.

@mokagio mokagio modified the milestones: 24.1, 24.2 Jan 22, 2024
@hassaanelgarem
Copy link
Contributor

@salimbraksa @alpavanoglu The testing instructions are a bit confusing to me. Are we testing the in-app badge over the notifications tab bar icon? Or are we testing the App Icon Badges?

The in-app badge works as expected.
The App Badge has never worked for me as well. @alpavanoglu Are you sure this is something we support? If yes, can you provide more detailed testing instructions?

@hassaanelgarem hassaanelgarem removed their request for review January 23, 2024 19:05
@alpavanoglu
Copy link
Contributor Author

alpavanoglu commented Jan 25, 2024

@hassaanelgarem @salimbraksa

The testing steps are for App Badges, and not in-app badge. Do you test it on a device or a simulator? I don't know why App badges are not working for you. They do work on my device just fine.

When we view the Notifications tab, the last seen value is checked to reset the badges afaik. I can send a screen recording over slack (I won't post here as I use my own account to see badges) if that would help.

The changes are simply copying over the logic to VM and I added tests. I mostly added the manual testing steps as "just in case".

…o refactor-notifications-vc

# Conflicts:
#	WordPress/Classes/Services/NotificationSyncMediator.swift
Copy link
Contributor

@salimbraksa salimbraksa left a comment

Choose a reason for hiding this comment

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

LGTM! 🚀

@alpavanoglu alpavanoglu merged commit 1b0c0a4 into trunk Jan 30, 2024
22 checks passed
@alpavanoglu alpavanoglu deleted the refactor-notifications-vc branch January 30, 2024 19:15
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.

5 participants