You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[REPORTING PAYMENT][$500] Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in #26615
The sign-in option is displayed. Also, the sign-in modal still has the previously entered magic code (Note: this may not be reproducible on the newest version - #26615 (comment))
Workaround:
Unknown
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.62.0 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
@adeel0202@kbecciv on v1.3.62-3, I can reproduce part of this issue - basically, the part I cannot reproduce is showing the Magic Link details prefilled. On the newest staging version, I see this:
However, leaving the room and opening a new tab and using the URL still shows a "Sign In" button - I think this should be fixed, since you shouldn't need to sign in again as all you've done is left the room.
changed the title [-]Web - Opening #teachers-unite directly through the link shows sign in option even when I'm signed in[/-][+]Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in[/+]on Sep 3, 2023
changed the title [-]Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in[/-][+][$500] Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in[/+]on Sep 3, 2023
Please re-state the problem that we are trying to solve in this issue.
Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in
What is the root cause of that problem?
The method in which we check to hide the composer and show sign in button is unreliable, there is no doubt here that we are facing a backend issue where leaving a room in some cases will result in session.authTokenType being returned by the backend as "anonymousAccount" and I believe that should be addressed on an internal level, however I think we should also address this on frontend level to avoid this kind of behaviour in the future as relying on authTokenType isn't the best idea when we have access to two more unique items that will be available when the user is signed in which are CREDENTIALS.login and CREDENTIALS.validateCode.
What changes do you think we should make in order to solve the problem?
We should refrain from using authTokenType and start using CREDENTIALS when we are checking for credentials as is the case with checking if isAnonymousUser, to do this we can make a change to session.isAnonymousUser to use these credentials for the check.
Another thing we can change is ReportUtils.shouldDisableWriteActions which uses isAnonymousUser that it calls itself from Onyx which is not good for keeping the code DRY as we are already connecting to the exact same part of Onyx in Session component so we can simply change the check for shouldDisableWriteActions to use the same Session.isAnonymousUser function.
functionshouldDisableWriteActions(report){constreportErrors=getAddWorkspaceRoomOrChatReportErrors(report);returnisArchivedRoom..||Session.isAnonymousUser();// Changing from local variable to calling Session component}
changed the title [-][HOLD][$500] Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in[/-][+][REPORTING PAYMENT][$500] Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in[/+]on Oct 6, 2023
Activity
melvin-bot commentedon Sep 3, 2023
Triggered auto assignment to @jliexpensify (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Sep 3, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)jliexpensify commentedon Sep 3, 2023
@adeel0202 @kbecciv on v1.3.62-3, I can reproduce part of this issue - basically, the part I cannot reproduce is showing the Magic Link details prefilled. On the newest staging version, I see this:
However, leaving the room and opening a new tab and using the URL still shows a "Sign In" button - I think this should be fixed, since you shouldn't need to sign in again as all you've done is left the room.
[-]Web - Opening #teachers-unite directly through the link shows sign in option even when I'm signed in[/-][+]Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in[/+][-]Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in[/-][+][$500] Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in[/+]melvin-bot commentedon Sep 3, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0164d1ccb8bef91f4d
melvin-bot commentedon Sep 3, 2023
Current assignee @jliexpensify is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Sep 3, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (
External)AmjedNazzal commentedon Sep 4, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in
What is the root cause of that problem?
The method in which we check to hide the composer and show sign in button is unreliable, there is no doubt here that we are facing a backend issue where leaving a room in some cases will result in session.authTokenType being returned by the backend as "anonymousAccount" and I believe that should be addressed on an internal level, however I think we should also address this on frontend level to avoid this kind of behaviour in the future as relying on authTokenType isn't the best idea when we have access to two more unique items that will be available when the user is signed in which are CREDENTIALS.login and CREDENTIALS.validateCode.
What changes do you think we should make in order to solve the problem?
We should refrain from using authTokenType and start using CREDENTIALS when we are checking for credentials as is the case with checking if isAnonymousUser, to do this we can make a change to session.isAnonymousUser to use these credentials for the check.
Another thing we can change is ReportUtils.shouldDisableWriteActions which uses isAnonymousUser that it calls itself from Onyx which is not good for keeping the code DRY as we are already connecting to the exact same part of Onyx in Session component so we can simply change the check for shouldDisableWriteActions to use the same Session.isAnonymousUser function.
Result
Screen.Recording.2023-09-04.at.3.16.19.AM.mov
22 remaining items
sobitneupane commentedon Sep 26, 2023
@pradeepmdk I don't think we need to raise PR here. I will be raised in the associated issue for which PR was raised.
pradeepmdk commentedon Sep 26, 2023
@sobitneupane this issue was solved only when we upgraded React native Onyx version 1.0.89.
sobitneupane commentedon Sep 27, 2023
We will wait for it to update from the associated issue.
pradeepmdk commentedon Sep 27, 2023
@sobitneupane Actually I only commented on that. based on my comment they raised the another PR.
Expensify/react-native-onyx#333
Expensify/react-native-onyx#333 (comment)
Expensify/react-native-onyx#359
pradeepmdk commentedon Sep 28, 2023
@sobitneupane this is fixed now.
jliexpensify commentedon Oct 6, 2023
@pradeepmdk thanks for letting us know. Just tried on v1.3.78-4 and can verify it's fixed.
Going to pay @adeel0202 for reporting and then close this out.
jliexpensify commentedon Oct 6, 2023
Payment Summary
Upworks Job
[-][HOLD][$500] Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in[/-][+][REPORTING PAYMENT][$500] Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in[/+]jliexpensify commentedon Oct 6, 2023
Paid, job closed!