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

[MBL-1095] Disable Message Reply Button When User Is Blocked #1905

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

scottkicks
Copy link
Contributor

📲 What

Disables the Reply bar button in message threads if the message participant has been blocked.

If we don't think this should go out with 5.11.0 I can avoid cutting a new build and this can go out in the next release. I think we can get it in though.

🤔 Why

We'll be stopping communication between users when one has been blocked.

🛠 How

MessagesViewModel has a replyButtonIsEnabled signal that I've updated to emit true only when there are messages and the participant isn't blocked.

✅ Acceptance criteria

  • If you've blocked someone, you should not be able to tap the reply button from that message thread
  • If you haven't blocked someone, you can still reply to them

@scottkicks scottkicks self-assigned this Dec 13, 2023
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (d98e4fe) 83.75% compared to head (7aa3bf3) 83.75%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1905   +/-   ##
=======================================
  Coverage   83.75%   83.75%           
=======================================
  Files        1229     1229           
  Lines      111842   111870   +28     
  Branches    29749    29752    +3     
=======================================
+ Hits        93670    93696   +26     
- Misses      17147    17149    +2     
  Partials     1025     1025           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

* keeps users from quick tapping Reply while the messages/project load
@scottkicks scottkicks force-pushed the scott/blocked-message-thread-reply-button branch from b9d6e6f to 7aa3bf3 Compare December 13, 2023 19:15
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There is a split second where users can tap Reply while we're pulling messages and project data. Defaulting the reply button's enabled prop to false instead, so users can't do that.

@scottkicks scottkicks changed the title [NO TICKET] Disable Message Reply Button When User Is Blocked [MBL-1095] Disable Message Reply Button When User Is Blocked Dec 13, 2023
@scottkicks scottkicks marked this pull request as ready for review December 13, 2023 19:42
@scottkicks scottkicks added this to the release-5.11.0 milestone Dec 13, 2023
Copy link
Contributor

@ifosli ifosli left a comment

Choose a reason for hiding this comment

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

Nice! I added a comment about the participantPreviouslyBlocked signal, which I think should be fixed, but I don't mind if that happens in a later PR instead.

self.replyButtonIsEnabled = Signal.merge(
self.viewDidLoadProperty.signal.mapConst(false),
self.participantPreviouslyBlocked = self.project
.map { $0.creator.isBlocked }
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit, kind of out of scope: It feels risky to me to check creator here instead of participant, since theoretically the creator could be the person doing the messaging. Right now, I don't think that's possible (since those messages don't show in the inbox on mobile), but that could (and maybe should) change in the future.

@scottkicks scottkicks merged commit 19d4ab9 into main Dec 13, 2023
7 checks passed
@scottkicks scottkicks deleted the scott/blocked-message-thread-reply-button branch December 13, 2023 20:34
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.

None yet

2 participants