-
Notifications
You must be signed in to change notification settings - Fork 3k
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 the unread count not going away when you've signed out #13600
Conversation
@puneetlath @sobitneupane 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] |
@tgolen lint check is failing. |
@sobitneupane if you're able to get to this soon, then I'll let you take the first crack at it. |
Fixed the lint errors 👍 |
@tgolen I didn't get the expected output. I tried sending some messages. But unread indicator did not update. Screen.Recording.2022-12-15.at.11.44.12.mov |
@sobitneupane i think that the subscription isn't imported anywhere in the App |
@@ -10,7 +10,6 @@ import compose from '../../compose'; | |||
import * as PersonalDetails from '../../actions/PersonalDetails'; | |||
import * as Pusher from '../../Pusher/pusher'; | |||
import PusherConnectionManager from '../../PusherConnectionManager'; | |||
import UnreadIndicatorUpdater from '../../UnreadIndicatorUpdater'; | |||
import ROUTES from '../../../ROUTES'; |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, sorry. I think I might have broken this when I just fixed the linter tests via the GitHub web interface. Sorry about that! Let me do this properly and test it out again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes looks good
OK, I fixed the lib import and retested it to make sure it's working again. |
@@ -10,7 +10,6 @@ import compose from '../../compose'; | |||
import * as PersonalDetails from '../../actions/PersonalDetails'; | |||
import * as Pusher from '../../Pusher/pusher'; | |||
import PusherConnectionManager from '../../PusherConnectionManager'; | |||
import UnreadIndicatorUpdater from '../../UnreadIndicatorUpdater'; | |||
import ROUTES from '../../../ROUTES'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks good to me, but @tgolen it looks like you have some unit tests failing.
@sobitneupane will you be able to review/test this PR in the next day?
OK, I'll look into those unit tests. |
Screenshots/VideosWebScreen.Recording.2022-12-16.at.18.14.54.movMobile Web - ChromeScreen.Recording.2022-12-17.at.10.32.44.movMobile Web - SafariScreen.Recording.2022-12-17.at.10.26.22.movDesktopScreen.Recording.2022-12-17.at.10.21.19.moviOSScreen.Recording.2022-12-16.at.18.22.05.movAndroidScreen.Recording.2022-12-16.at.18.57.03.mov |
OK, I'm not sure how that can happen, but I've added a check for a null report object now which should prevent that from happening. |
@sobitneupane are you able to test again? |
@tgolen With the latest change, when we reload the page after sign out (or close the tab and reopen expensify on new tab after signout), the unread count reappears. Tested with the following account: I was able to reproduce the issue on chrome only (not on firefox, safari and chrome incognito). |
OK, thanks for reporting that. Let me look into that. That's really strange. |
I tried to reproduce it, and I couldn't reproduce it in Chrome on either MacOS or Android mobile web. This is what I did:
I'm going to remerge |
I was able to reproduce similar issue in staging as well. When I log out from one account and login to another account, reports from logged out account also appears in the newly logged in account. For example, in the following picture reports in LHN with red capsule do not belong to currently logged in user. So, I think #13600 (comment) bug is also caused by the same issue. |
I don't think I'm following you. The changes in this PR can't affect anything on staging, so the changes here should only improve any problems you saw on staging. |
I mean to say #13600 (comment) and #13600 (comment) bug might be caused by same issue. And might not be related to this PR. I will report it in expensify-bug channel to see if any other user has seen the similar bug. |
Screen.Recording.2022-12-21.at.01.04.57.mov |
@sobitneupane so are you still seeing issues with this PR or no? I just tried testing on Chrome and wasn't able to reproduce the issue. |
@puneetlath Yes, I am still reproduce #13600 (comment) issue. Interestingly, I can only reproduce it on chrome non-incognito. |
Hm, I was definitely also testing it in chrom non-icognito. When I first tried to reproduce it, I thought it happened, but then I had some errors in the JS console about missing libs, and that's when I ended up remerging |
@tgolen I haven't tested these changes yet , but what I see in @sobitneupane video I can see where the bug is . i can tell that this is related to both onyx clear logic which delay clearing and the fact that you have imported the subscriber in the whole App . The subsriber should be imported in AuthScreen . Because when he refresh before onyx finish , the data that wasn't cleared will be used by onyx and the subscriber will be triggered again (we have data and subscriber is imported) a fix for this will be to import subscriber on AuthScreen and/or to close the subscriber connection after logout
Edit: I think this is enough to fix the issue |
@tgolen as yo can see here the subscriber callback is called on guest screen when Onyx have data (unfinished clearing) Screen.Recording.2022-12-21.at.1.27.24.PM.mov |
@fedirjh Thanks for those comments! I think it's perfectly fine to have the subscriber where it is. Shouldn't we be more concerned with why there is still report data in Onyx after signing out? That seems to be the root of the issue. |
Today I tried to reproduce the issue with a large account. I've got an account with 4000 reports and 4000 users, and I wasn't able to reproduce the issue of Onyx not clearing out all the data. I think we need to try and zero-in on how exactly to reproduce that and treat it as a separate issue. Though, I also saw that we are reverting some of the changes to For this PR, I think the changes are good and will remain good regardless of what happens to fix |
We have new issue to handle issues like this. I think we can move forward this this PR. @puneetlath Overall change looks good to me. |
There was a problem hiding this comment.
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 verified the steps for local testing are in the
- 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 notonIconClick
). - 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
- 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.
- 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 usingAvatar
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. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor) - Any internal methods bound to
this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
) - 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 thatAvatar
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.
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by @puneetlath in version: 1.2.47-0 🚀
|
🚀 Deployed to production by @roryabraham in version: 1.2.47-0 🚀
|
Fixed Issues
$ #11671
Tests
For web, desktop, and mobile web:
For native devices:
The badge counters don't work in local environment, so they can't really be tested. Just generally do some regression testing to ensure that the unread stuff works like it should
Offline tests
web offline test video
2022-12-14_13-42-55.mp4
QA Steps
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.Screenshots/Videos
Web
2022-12-14_13-19-25.mp4
Mobile Web - Chrome
2022-12-14_13-46-21.mp4
Mobile Web - Safari
2022-12-14_13-47-05.mp4
Desktop
2022-12-14_13-20-32.mp4
iOS
2022-12-14_13-26-38.mp4
Android
2022-12-14_13-32-16.mp4