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

fix: 22383 Whole thread disappears if the thread header is flagged as an Assault or Harassment #28002

Merged
merged 47 commits into from
Feb 2, 2024

Conversation

tienifr
Copy link
Contributor

@tienifr tienifr commented Sep 22, 2023

Details

Fixed Issues

$ #22383
PROPOSAL: #22383 (comment)

Tests

  1. Send a message from user A to user B
  2. From the tab where user B is signed-in, reply to the message in a thread
  3. Flag the first message in the thread - the message you replied to - as Harassment or Assault
  4. Verify that the Hidden message is shown
  5. Click on the thread chat, the Hidden message is shown in the header and in the first action
  • Verify that no errors appear in the JS console

Offline tests

Same as above

QA Steps

Note: Some of this may reveal additional front end bugs. If you notice them, please try to see if they're on production already. If you have questions, you can reach out to @dangrous!

  1. Send a message from user A to user B
  2. From the tab where user B is signed-in, reply to the message in a thread
  3. Flag the first message in the thread - the message you replied to - as Harassment or Assault
  4. Verify that the Hidden message is shown
  5. Click on the thread chat, the Hidden message is shown in the header and in the first action
  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • If we are not using the full Onyx data that we loaded, I've added the proper selector in order to ensure the component only re-renders when the data it is using changes
      • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web
Screen.Recording.2023-08-01.at.17.59.05.mov
Mobile Web - Chrome
Screenrecorder-2023-09-22-16-22-04-45.mp4
Mobile Web - Safari
Screen.Recording.2023-09-22.at.16.18.52.mov
Desktop
Screen.Recording.2023-09-22.at.16.57.36.mov
iOS
Screen.Recording.2023-09-22.at.17.06.14.mov
Android
android-compressed.mov

@tienifr tienifr marked this pull request as ready for review September 22, 2023 10:07
@tienifr tienifr requested a review from a team as a code owner September 22, 2023 10:07
@melvin-bot melvin-bot bot requested review from situchan and removed request for a team September 22, 2023 10:07
@melvin-bot
Copy link

melvin-bot bot commented Sep 22, 2023

@situchan Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@situchan
Copy link
Contributor

@tienifr did you read last discussion on GH? LHN last message isn't fixed

Screenshot 2023-09-25 at 6 48 54 AM

@tienifr
Copy link
Contributor Author

tienifr commented Sep 25, 2023

Thanks for pointing that out, Should we hold this one until the issue is fixed?

@situchan
Copy link
Contributor

situchan commented Sep 25, 2023

Thanks for pointing that out, Should we hold this one until the issue is fixed?

@dangrous what do you suggest?
-consider LHN out of scope
-fix LHN as well which also might fix #19722
-hold this PR for #19722

@dangrous
Copy link
Contributor

Would there be any harm in considering LHN out of scope (would any solution to #19722 end up breaking this, or vice versa)? If not, I think they're separate enough that we can handle separately.

@situchan
Copy link
Contributor

I think we should take responsible for preventing raw message display at least on this PR - #28002 (comment).
If we consider this out of scope, I am afraid this will never be fixed anywhere as #19722 will fix just display issue, not display content.

@situchan
Copy link
Contributor

@tienifr I think we can fix LHN issue here as it's not complex. So it should show [Hidden message] instead of hi in this screenshot.
I don't want this delay of waiting affect timeline.

@tienifr
Copy link
Contributor Author

tienifr commented Sep 26, 2023

@situchan Updated PR as this comment

@dangrous
Copy link
Contributor

Yep, that's fine by me!

@situchan
Copy link
Contributor

@tienifr please update all recordings which fixed LHN

@situchan
Copy link
Contributor

@tienifr I am not seeing [Hidden message] in parent report and LHN. Still shows original message.
Can you make sure to test all possible cases before request review?

Screen.Recording.2023-09-26.at.7.44.27.PM.mov

@situchan
Copy link
Contributor

Another bug: user login: [Hidden message] instead of [Hidden message]

Screen.Recording.2023-09-26.at.8.06.47.PM.mov

@tienifr
Copy link
Contributor Author

tienifr commented Sep 26, 2023

@situchan Why do we need user login: here? In #19722, we just expect to show [Deleted message], so I think we should show [Hidden message] in this case.

@situchan
Copy link
Contributor

@situchan Why do we need user login: here? In #19722, we just expect to show [Deleted message], so I think we should show [Hidden message] in this case.

please check my video. We don't need user login: but your PR shows

@tienifr
Copy link
Contributor Author

tienifr commented Sep 26, 2023

Ah sorry @situchan I saw it

@tienifr
Copy link
Contributor Author

tienifr commented Sep 26, 2023

@situchan Can you show me your steps to reproduce the bug, as I can't face this problem

Screenshot 2023-09-26 at 22 34 34

@situchan
Copy link
Contributor

situchan commented Sep 26, 2023

You will find those bugs if you test all possible scenarios:

  • no child message / has child message
  • account A's view / account B's view (A is who sent parent message, B is who flagged that message)
  • flagged message is last message / there's new message (not deleted, not flagged) after flagged message

Test:

  • parent message on parent chat
  • parent message on thread chat
  • parent chat on LHN
  • thread chat on LHN

@tienifr
Copy link
Contributor Author

tienifr commented Sep 26, 2023

@situchan Sorry but I can't reproduce this bug even once

@tienifr
Copy link
Contributor Author

tienifr commented Sep 26, 2023

Can you please share the video?

@tienifr
Copy link
Contributor Author

tienifr commented Sep 26, 2023

But I found out the following bug:

  1. Send the image from account A
  2. Send the normal message from account A
  3. Reply in thread
  4. From account B, flag this parent message as harassment message
  5. Wait for a sec, the last message of LHN will be change to [Attachment] because BE returns report.lastMessageText: [Attachment]

I think it will be handled in #19722 that we need BE fix

@situchan
Copy link
Contributor

@tienifr please try in task report, same as my video
Anyway are you fixing #28002 (comment)?

@tienifr
Copy link
Contributor Author

tienifr commented Sep 26, 2023

@situchan I tested all your cases here before requesting your review and I'm sure everything is ok

While I trying to reproduce your bug, I found 2 edge cases:

bug 1 (need BE fix): #28002 (comment)

bug 2 (fixed):

  1. Send 2 the normal messages from account A
  2. Delete second message
  3. Reply in thread of first message
  4. From account B, flag first parent message as harassment message
  5. The [Hidden message] is not shown

@dangrous
Copy link
Contributor

This is looking good; @situchan can you give it one last review/test please? Thanks!

@dangrous
Copy link
Contributor

argh sorry @tienifr can you merge main again, and then - @situchan as soon as you see the merge can you please prioritize this review? I'd like to get it out in the next 24 hours and we're finally almost there

@situchan
Copy link
Contributor

sure I will re-test immediately once conflict is fixed

@dangrous
Copy link
Contributor

@tienifr do you think you can remerge main today? Thanks!

@tienifr
Copy link
Contributor Author

tienifr commented Jan 31, 2024

@dangrous @situchan merged main. Can you help process test this?

@situchan
Copy link
Contributor

on it now

@situchan
Copy link
Contributor

I think something broken on production. this view doesn't show at all for messages yellow flagged today. But still showing the ones flagged in the past

Screenshot 2024-01-31 at 11 11 38 PM Screenshot 2024-01-31 at 11 12 59 PM

@situchan
Copy link
Contributor

Otherwise looks good! Not found any issue which doesn't happen on main/staging.

@dangrous
Copy link
Contributor

dangrous commented Feb 1, 2024

ugh that's annoying.

Okay so one last question, re: testing - given all the bugs that are building up on main, are we confident that this does the job it's meant to do? And, also - will QA be able to QA this? Do we need to update the QA steps at all?

Thanks!

@situchan
Copy link
Contributor

situchan commented Feb 1, 2024

will QA be able to QA this? Do we need to update the QA steps at all?

The main QA step doesn't change but I believe many issues will be reported while testing.
Hopefully #28002 is failing with #xxx, reproduced on prod, checking off 🙏

@dangrous
Copy link
Contributor

dangrous commented Feb 1, 2024

Okay that's okay I think - I can add a note to the QA steps to sync with me (or here) if they have questions/see new bugs and that they're likely to be on prod as well.

Do you want to give a final ✅ @situchan and then I'll get this merged?

@dangrous
Copy link
Contributor

dangrous commented Feb 1, 2024

As long as we can confirm this does what we want, despite the other bugs, then that's good for me. Code looks good

Copy link
Contributor

@situchan situchan left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor

@dangrous dangrous left a comment

Choose a reason for hiding this comment

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

Alright! Thanks for your patience, both! Let's get this merged.

@dangrous dangrous merged commit 8fa0994 into Expensify:main Feb 2, 2024
17 checks passed
@OSBotify
Copy link
Contributor

OSBotify commented Feb 2, 2024

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented Feb 5, 2024

🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 1.4.36-5 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

1 similar comment
@OSBotify
Copy link
Contributor

OSBotify commented Feb 5, 2024

🚀 Cherry-picked to staging by https://github.com/thienlnam in version: 1.4.36-5 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@dangrous
Copy link
Contributor

dangrous commented Feb 6, 2024

@situchan @tienifr this is what we anticipated, right? I think we can move forward with this and reclose #34151 but please confirm - thanks!

@situchan
Copy link
Contributor

situchan commented Feb 7, 2024

@situchan @tienifr this is what we anticipated, right? I think we can move forward with this and reclose #34151 but please confirm - thanks!

right - #28002 (review)

@OSBotify
Copy link
Contributor

OSBotify commented Feb 7, 2024

🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.37-7 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants