Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Remove dead code from Notifications #24104

Draft
wants to merge 5 commits into
base: trunk
Choose a base branch
from

Conversation

kean
Copy link
Contributor

@kean kean commented Feb 20, 2025

To the best of my knowledge, the code that displays comments in NotificationDetailsViewController is also dead. The app has been using NotificationCommentDetailViewController with its underlying CommentDetailViewController for a while now instead.

To test:

Regression Notes

  1. Potential unintended areas of impact

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

  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.

Testing checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • VoiceOver.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • iPhone and iPad.
  • Multi-tasking: Split view and Slide over. (iPad)

@dangermattic
Copy link
Collaborator

dangermattic commented Feb 20, 2025

1 Warning
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.

Generated by 🚫 Danger

@kean kean added the Comments label Feb 20, 2025
@kean kean added this to the Pending milestone Feb 20, 2025
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 20, 2025

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 Numberpr24104-a9adaff
Version25.7.1
Bundle IDorg.wordpress.alpha
Commita9adaff
App Center BuildWPiOS - One-Offs #11533
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 Feb 20, 2025

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 Numberpr24104-a9adaff
Version25.7.1
Bundle IDcom.jetpack.alpha
Commita9adaff
App Center Buildjetpack-installable-builds #10565
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.

return false
}
return block.action(id: ReplyToCommentAction.actionIdentifier())?.on ?? false
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this variable always false? If not, replyTextView may appear in the UI and is now removed from this PR.

case .comment:
return NoteBlockCommentTableViewCell.reuseIdentifier()
case .actions:
return NoteBlockActionsTableViewCell.reuseIdentifier()
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what's going on here. Do we just not handle these two kinds of content, and let if fall to the default case and use the a default cell?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's a good point. This code is extremely hard to follow because it's parsing notification payload returned by the server. I'd suggest that instead of removing this code right away, let's add wpAssertionFailure in every code path we think can be removed, and then remove the code only when we are confident it's dead.

@kean kean force-pushed the task/remove-unused-notifications-code branch from 2e6b354 to a9adaff Compare February 22, 2025 17:02
@kean kean marked this pull request as draft February 22, 2025 17:09
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants