Skip to content

Ignore close action for archived workspace chats - #13887

Merged
mountiny merged 3 commits into
mainfrom
marco-ignoreCloseAction
Jan 14, 2023
Merged

mountiny merged 3 commits into
mainfrom
marco-ignoreCloseAction

Conversation

@marcochavezf

@marcochavezf marcochavezf commented Dec 29, 2022

Copy link
Copy Markdown
Contributor

Details

Ignore the close action that was originally generated for OldDot (more details here), since we're already displaying the footer when a chat report is closed.

Fixed Issues

$ #13839

Tests

  1. Create a Workspace chat (Go to Settings > Workspaces > New workspace)
  2. Delete it
  3. Open the archived workspace chat
  4. Verify the message "You closed this report" doesn't appear (just the footer explaining why the workspace chate is no longer active).
  • Verify that no errors appear in the JS console

Offline tests

N/A

QA Steps

Same as Test steps.

  • 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 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
    • 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 correct English and 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • 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 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 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.
  • I have checked off every checkbox in the PR author checklist, including those that don't apply to this PR.

Screenshots/Videos

Web Screenshot 2022-12-29 at 13 04 12
Mobile Web - Chrome Screenshot 2022-12-29 at 13 06 37
Mobile Web - Safari Screenshot 2022-12-29 at 13 04 43
Desktop Screenshot 2022-12-29 at 13 08 33
iOS Screenshot 2022-12-29 at 13 07 00
Android Screenshot 2022-12-29 at 13 14 57

@marcochavezf
marcochavezf requested a review from a team as a code owner December 29, 2022 19:15
@marcochavezf marcochavezf self-assigned this Dec 29, 2022
@melvin-bot
melvin-bot Bot requested review from AndrewGable and parasharrajat and removed request for a team December 29, 2022 19:16
@melvin-bot

melvin-bot Bot commented Dec 29, 2022

Copy link
Copy Markdown

@parasharrajat @AndrewGable One of you needs to 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]

Comment thread src/pages/home/report/ReportActionItem.js Outdated
@marcochavezf

Copy link
Copy Markdown
Contributor Author

Updated and re-tested on all platforms 👍🏽

@parasharrajat

Copy link
Copy Markdown
Member

Create a Workspace chat

How can I do that?

@marcochavezf

Copy link
Copy Markdown
Contributor Author

How can I do that?

Ah go to Settings > Workspaces > New workspace, I updated the instructions.

@parasharrajat

parasharrajat commented Jan 2, 2023

Copy link
Copy Markdown
Member

Is there an issue? I don't see this message.

image


Without this PR changes but on this PR.
Screenshot 2023-01-02 23:06:13

@parasharrajat

Copy link
Copy Markdown
Member

Ok, #13887 (comment) this seems like a different issue. It worked for the second workspace I created.

@parasharrajat

parasharrajat commented Jan 3, 2023

Copy link
Copy Markdown
Member

Screenshots

🔲 iOS / native

Screenshot 2023-01-04 19:23:14

🔲 iOS / Safari

Can't sign in due to gateway issues.

🔲 MacOS / Desktop

Not able to see the archived chat.

🔲 MacOS / Chrome

Screenshot 2023-01-03 21:40:10

🔲 Android / Chrome

Can't sign in due to gateway issues.

🔲 Android / native

Not able to see the archived chat.

screen-2023-01-04_19.56.00.mp4

@parasharrajat

Copy link
Copy Markdown
Member

Why don't I see no workspace chat on Android but the same is present on web?

}

// Ignore closed action here since we're already displaying a footer that explains why the report was closed
if (reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.CLOSED) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Question: Do we only have CONST.REPORT.ACTIONS.TYPE.CLOSED action in workspace chat? What if the same action is passed for rooms or normal chat?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That action is generated in the backend for all report chats and we're already handling the close action to display the footer generically here. Afaik we're only archiving workspace chats (policyExpenseChat) but if we eventually pass the same action for other report chats I think the ReportFooter will handle it gracefully.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok, going to follow your lead on this. I don't have much idea about the design for this feature.

@marcochavezf

marcochavezf commented Jan 3, 2023

Copy link
Copy Markdown
Contributor Author

Is there an issue? I don't see this message.

Oh when I tested I always saw that message, I tested again with a new account and the "no longer active" message is shown:

Screen.Recording.2023-01-03.at.12.07.49.mov

Why don't I see no workspace chat on Android but the same is present on web?

Could you expand more on this? I re-tested on Android and the footer message appears as expected:

Screenshot 2023-01-03 at 12 12 33

@parasharrajat

Copy link
Copy Markdown
Member

Why don't I see no workspace chat on Android but the same is present on web?

I am not seeing any workspace chat in LHN on the Android dev build. FYI, I am not using .env file. It should be picking defaults.

Is there an issue? I don't see this message.

For this, I still have a workspace chat whose workspace is deleted. It's title is not updated to archived. Strange maybe the request failed or something happened that prevented it from being changed. But it is not related to this PR.

@parasharrajat

parasharrajat commented Jan 4, 2023

Copy link
Copy Markdown
Member

Ok, I see that the issue is workspace chat is not synced across devices. If I create the chat on the web, the chat is created there but not visible on android. and If they create the workspace on android, then it won't show on the web. Although rooms are being synced correctly.

There is another issue where workspace chat is renamed back to default name after deleting it.

screen-2023-01-04_19.56.00.mp4

@parasharrajat

parasharrajat commented Jan 4, 2023

Copy link
Copy Markdown
Member

This workspace chat is very buggy. There are different bugs on different platforms. But I am sure that the change in this PR is working as it should be.

I think we are good to merge this. All the issues that I have reported are unrelated to this PR. Let me know once you have reviewed the issues above.

I tried to capture videos for all the platforms but not able to see the archived chat on all of them.

@marcochavezf

Copy link
Copy Markdown
Contributor Author

There is another issue where workspace chat is renamed back to default name after deleting it.

Ah this is an interesting bug and I can't reproduce it constantly, seems it happens when the connection is intermittent. Have you reported those issues in #expensify-bugs?

I think we are good to merge this. All the issues that I have reported are unrelated to this PR. Let me know once you have reviewed the issues above.

Thanks, I think we're missing the PR reviewer checklist here.

@parasharrajat

Copy link
Copy Markdown
Member

I will report these bugs.

@parasharrajat parasharrajat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • Android / native
    • Android / Chrome
    • iOS / native
    • iOS / Safari
    • MacOS / Chrome / Safari
    • MacOS / Desktop
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (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 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
    • 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 correct English and 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • 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
  • 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • 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 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 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

cc: @AndrewGable

🎀 👀 🎀 C+ reviewed

@parasharrajat parasharrajat left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There are tests to be updated.

expect(result).toStrictEqual(input);
});

it('should filter out closed actions', () => {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a new unit test to check if a closed action is removed and updated the existing one that had a closed action.

@trjExpensify

Copy link
Copy Markdown
Contributor

Came across this bug as we pick N7 back up and I was running end-to-end tests Workspace Chats as we look to get the project over the line.

This workspace chat is very buggy. There are different bugs on different platforms.

I'd love to dig into that more with you. Which platforms? I've run tests on Web & iOS so far and it's working pretty good and consistent. I have a full written script if you're interested in taking a look.

There is another issue where workspace chat is renamed back to default name after deleting it.

What does this mean exactly, what's "default name"? The workspace chat does have a different chat title depending on the viewer of the chat as an FYI:

Admin POV = memberName (or memberPrimaryLogin)
Workspace Chat Owner POV = workspaceName

@parasharrajat

parasharrajat commented Jan 13, 2023

Copy link
Copy Markdown
Member

I found the following issues

  1. Workspace chat was not getting synced from one platform to another. I reported it but not sure why it is only happening to me.
  2. Sometimes, the archived chat was not shown to be me when the workspace was deleted.
  3. Default name was username's workspaceName chat.

These were all dev. I will try to test these on staging.

@parasharrajat

Copy link
Copy Markdown
Member

Anyways, this PR is ready to be merged.

@mountiny mountiny left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Came hew from working on some other Workspace chat, changes look good to me and I agree we can explore all the bugs as we test this through, thanks @parasharrajat for such thorough testing.

I am going to merge this now!

@mountiny
mountiny merged commit 7ca2979 into main Jan 14, 2023
@mountiny
mountiny deleted the marco-ignoreCloseAction branch January 14, 2023 21:44
@github-actions

Copy link
Copy Markdown
Contributor

Performance Comparison Report 📊

Significant Changes To Duration

There are no entries

Meaningless Changes To Duration

Show entries
Name Duration
App start TTI 664.926 ms → 687.299 ms (+22.373 ms, +3.4%)
App start nativeLaunch 19.733 ms → 21.063 ms (+1.329 ms, +6.7%)
App start regularAppStart 0.020 ms → 0.015 ms (-0.006 ms, -27.1%) 🟢
App start runJsBundle 189.219 ms → 186.759 ms (-2.460 ms, -1.3%)
Open Search Page TTI 602.663 ms → 598.576 ms (-4.088 ms, -0.7%)
Show details
Name Duration
App start TTI Baseline
Mean: 664.926 ms
Stdev: 28.957 ms (4.4%)
Runs: 611.0665419995785 628.0267459992319 628.157454000786 628.7275610007346 629.2918369993567 638.815421000123 641.4754840005189 642.6122270002961 649.0530280005187 651.9066589996219 654.9200090002269 657.0478109996766 661.2822789996862 661.7007710002363 663.1328100003302 664.0634530000389 666.3072289992124 667.1667640004307 668.5384810008109 671.7962539996952 672.9674340002239 673.2550789993256 676.6959220003337 679.4827420003712 683.9185230005533 695.2648179996759 708.4043099991977 713.153898999095 720.8128769993782 738.7381139993668

Current
Mean: 687.299 ms
Stdev: 25.832 ms (3.8%)
Runs: 631.685515999794 647.2268129996955 658.1250449996442 659.6716339997947 661.8964629992843 666.3036419991404 667.8884800001979 669.1256349999458 669.5363769996911 670.7801009994 671.5067279990762 673.942018000409 674.0737059991807 675.018062999472 688.7095819991082 689.7067350000143 691.4823260009289 691.7563150003552 692.7317629996687 694.3888879995793 694.8614649996161 696.3815870005637 701.6055309996009 701.7655009999871 710.3305779993534 712.126724999398 717.4926169998944 718.2361990008503 725.7961199991405 729.2313299998641 752.9009700007737
App start nativeLaunch Baseline
Mean: 19.733 ms
Stdev: 1.611 ms (8.2%)
Runs: 17 18 18 18 18 18 18 18 18 19 19 19 19 19 20 20 20 20 20 20 20 21 21 21 21 22 22 22 23 23

Current
Mean: 21.063 ms
Stdev: 2.423 ms (11.5%)
Runs: 17 18 18 18 18 19 19 19 19 20 20 20 20 20 20 20 21 21 22 22 22 22 22 22 23 23 23 24 24 25 26 27
App start regularAppStart Baseline
Mean: 0.020 ms
Stdev: 0.002 ms (9.7%)
Runs: 0.01794400066137314 0.018310001119971275 0.018351001664996147 0.01855500042438507 0.018635999411344528 0.0186769999563694 0.0186769999563694 0.018880000337958336 0.019206000491976738 0.019368000328540802 0.01940999925136566 0.019572000950574875 0.01977499946951866 0.020100999623537064 0.0201409999281168 0.020142000168561935 0.020222999155521393 0.020263999700546265 0.020304000005126 0.020711999386548996 0.02087399922311306 0.02099599875509739 0.021525001153349876 0.021566001698374748 0.021890999749302864 0.022420000284910202 0.02445399947464466 0.024617999792099 0.026367001235485077

Current
Mean: 0.015 ms
Stdev: 0.001 ms (5.3%)
Runs: 0.01371300034224987 0.013996999710798264 0.014077998697757721 0.014078998938202858 0.014118999242782593 0.014241000637412071 0.014241999015212059 0.014281999319791794 0.014364000409841537 0.014364000409841537 0.014526000246405602 0.014526000246405602 0.014526000246405602 0.014527000486850739 0.014607999473810196 0.014607999473810196 0.014608001336455345 0.01464799977838993 0.014770999550819397 0.014851000159978867 0.014892000705003738 0.014932999387383461 0.01505499891936779 0.01505500078201294 0.015341000631451607 0.015828000381588936 0.01591000147163868 0.01603200100362301 0.01615399867296219 0.016154000535607338 0.01660200022161007 0.016805000603199005
App start runJsBundle Baseline
Mean: 189.219 ms
Stdev: 25.701 ms (13.6%)
Runs: 156 159 159 163 164 165 166 167 170 171 176 176 177 179 182 182 182 183 187 188 190 198 198 199 207 214 218 222 222 232 249 254

Current
Mean: 186.759 ms
Stdev: 12.937 ms (6.9%)
Runs: 161 166 169 170 172 177 179 180 183 184 184 184 185 185 186 186 186 188 189 189 189 190 196 197 199 204 209 214 215
Open Search Page TTI Baseline
Mean: 602.663 ms
Stdev: 22.891 ms (3.8%)
Runs: 562.0587159991264 564.6798099987209 574.8418380003422 575.2352710012347 577.531006000936 578.5832930002362 579.5744230002165 584.4602869991213 586.3620199989527 586.5278730001301 586.9623619988561 590.4492600001395 591.9438480008394 593.7660320010036 595.0802009999752 596.7711999993771 596.9119869992137 601.9351809993386 605.0254309996963 606.3566079996526 611.3852949999273 613.093830998987 615.8338629994541 617.7136639989913 620.797933999449 624.7427169997245 625.6818850003183 627.3686939999461 630.7282710000873 638.0619310010225 642.0246179997921 642.2279059998691 643.1680919993669

Current
Mean: 598.576 ms
Stdev: 20.173 ms (3.4%)
Runs: 551.4833179991692 564.2755950000137 568.3585609998554 568.9191079996526 569.5733239986002 569.812867000699 576.465616999194 579.9892990011722 588.5548920016736 589.5879320017993 593.8221850004047 593.8887130003422 598.9108890015632 598.9115400016308 599.4119869992137 599.4252530001104 600.1638190001249 600.297201000154 604.7239989992231 607.0763759985566 607.6682940013707 609.0212399996817 612.6933590006083 613.4262290000916 613.5107420012355 615.2758389990777 617.0957030002028 617.3677570000291 618.7257090006024 620.9484459999949 623.2570799998939 624.0539549998939 636.297364000231

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by @mountiny in version: 1.2.55-0 🚀

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

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by @AndrewGable in version: 1.2.55-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 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