Repository navigation
Description
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
- Go to staging dot on web chrome and login with User A
- Create a new workspace and invite User B
- Login with User B on another web chrome (to reproduce the bug, place the windows side by side)
- From User A and User B, go to announce channel
- From User A, go to top header, go to 'Who can post' (Please do not click any option now)
- From User B, type any short message (do not click on send).
- From user A, select 'Admins Only' and see that on The User B side, the chat composer disappears
- But now, again select the 'All members' on User A side. Whereas on User B side, type in
:smile:(first colon and emoji name), and then copy the ":smile:" - Then, hold cmd+V to automatically paste it multiple times in a row back-to-back, until you have 5+ rows of the emoji pasted.
- Do not click Send
- From User A, again select 'Admins Only' and notice that on User B side, the chat composer doesn't disappear and we are able to send other messages too.
Expected Result:
A user should not be able to type in the workspace after 'Admins only' is selected.
Actual Result:
A user is able to type in the workspace chat after the 'Admins only' setting is selected, by using ":emoji:" pasted in succession for multiple rows. This introduces so type of lag that allows the user to keep typing
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
- Android / native
- Android / Chrome
- iOS / native
- iOS / Safari
- MacOS / Chrome / Safari
- MacOS / Desktop
Version Number: 1.3.28-3
Reproducible in staging?: y
Reproducible in production?: y
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
error-2023-06-05_19.15.24.mp4
Recording.978.mp4
Expensify/Expensify Issue URL:
Issue reported by: @priya-zha
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1685972438902859
Activity
melvin-bot commentedon Jun 15, 2023
Triggered auto assignment to @michaelhaxhiu (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Jun 15, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)DanutGavrus commentedon Jun 15, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Able to by pass 'Admins only' functionality using :emoji in multiple lines
What is the root cause of that problem?
Inside
ReportActionCompose.js, we callupdateFrequentlyUsedEmojiseach time we edit the message, each starting a network call. The back-end sends a notification back to the current user for each emoji added, and the notification that the room has changed to admins only comes with a delay. Thus, adding more emojis in chat => easier to reproduce the bug.What changes do you think we should make in order to solve the problem?
We should debounce the
updateFrequentlyUsedEmojismethod same as we do with other methods insideReportActionCompose.js. With these changes:the bug is no longer reproducible, no matter how many emojis are added in chat.
EDIT: 1000 may be too much for the debounce, I see that the bug is not reproducible with 75 either, so I think we should go with a lower value, 75 or near here.
DanutGavrus commentedon Jun 15, 2023
If you can't reproduce this bug from the first try, you may also try this:
More rows at step 2 = increased delay for the "only admins" change to take effect = easier to reproduce
michaelhaxhiu commentedon Jun 20, 2023
looking!
michaelhaxhiu commentedon Jun 20, 2023
Hm this isn't working for me and I'm not sure why
tried this
:smile :smile :smile.... format too and no luckDanutGavrus commentedon Jun 20, 2023
@michaelhaxhiu if you do not input enough rows of smile: the time window in which you are able to by-pass admins-only is short. Have a look at this:
bypass_admins.mp4
michaelhaxhiu commentedon Jun 20, 2023
So like after I delete the 6+ rows of
smile:then try to rapidly type messages in the workspace #announce?DanutGavrus commentedon Jun 20, 2023
Something like that. Each
smile:adds a small delay of lets sayx. 10smile:would be10x, and so on. Thus, 6 rows grant a very large time window. If usersB changes his room to admins only whilextime has not passed, the change does not take effect for you(userA), so you may keep typing other messages. By doing so, the change will never take place for you. By waiting longer forxtime to pass, it will eventually take effect for you too.The back-end however, knows about the admins-only, so the messages will not appear to other members, but as I see, no error appears when sending them, and they will remain in your chat afterwards. I still have the messages I've sent in the video in #announce and for me, they appear like they were sent, still no error message appears.
Other small problem is that back-end will still let all other users see when you are typing even if it knows about the admins only, as you may see in the video.
56 remaining items
michaelhaxhiu commentedon Jul 19, 2023
Invited Priya & Tien to the job in Upwork
sobitneupane commentedon Jul 19, 2023
@michaelhaxhiu I will request payment via newDot.
michaelhaxhiu commentedon Jul 19, 2023
Ok cool, got it! Can you work on the checklist as the next step?
michaelhaxhiu commentedon Jul 19, 2023
Update: Contributor & bug reporter are paid. Just waiting for sobit to confirm payment was made and complete the checklist.
[-][HOLD for payment 2023-07-14] [$1000] Able to by pass 'Admins only' functionality using :emoji in multiple lines[/-][+][HOLD for sobit] [$1000] Able to by pass 'Admins only' functionality using :emoji in multiple lines[/+]michaelhaxhiu commentedon Jul 24, 2023
@sobitneupane have you requested payment yet? Can you work on the checklist today?
sobitneupane commentedon Jul 24, 2023
#6498
The issue was introduced while adding the functionality of frequently used emojis 2 years back.
It's an edge case and very difficult to reproduce. I don't think this could have been caught in PR review.
No. It is an edge case and might be difficult to test.
sobitneupane commentedon Jul 24, 2023
Requested payment on newDot.
michaelhaxhiu commentedon Jul 26, 2023
cool, all set - closing.
JmillsExpensify commentedon Jul 27, 2023
Reviewed details for @sobitneupane. This is accurate based on summary from Business Reviewer and approved for payment in NewDot.