Skip to content

[REPORTING PAYMENT][$500] Web - Opening the #teachers-unite room directly through the link shows sign in option even when signed in #26615

Closed

Description

@kbecciv

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:

  1. Logout if already logged in
  2. Go to https://staging.new.expensify.com/r/207591744844000
  3. Click on the Sign in button
  4. Enter the email and click Continue
  5. Enter magic code
  6. Next, click on the #teachers-unite room header
  7. Click on Leave room
  8. Open a new tab and go to https://staging.new.expensify.com/r/207591744844000

Expected Result:

The sign-in option should not be displayed

Actual Result:

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

Screen.Recording.2023-08-30.at.12.51.28.PM.mov
Recording.4216.mp4

Expensify/Expensify Issue URL:
Issue reported by: @adeel0202
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693382434318589

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0164d1ccb8bef91f4d
  • Upwork Job ID: 1698473014682202112
  • Last Price Increase: 2023-09-10

Activity

  1. added
    BugSomething is broken. Auto assigns a BugZero manager.
    on Sep 3, 2023
  2. melvin-bot commented on Sep 3, 2023

    @melvin-bot

    Triggered auto assignment to @jliexpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

  3. melvin-bot commented on Sep 3, 2023

    @melvin-bot

    Bug0 Triage Checklist (Main S/O)

    • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
    • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
      • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
    • This bug is reproducible using the reproduction steps in the OP. S/O
      • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
      • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
    • This issue is filled out as thoroughly and clearly as possible
      • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
    • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync
  4. jliexpensify commented on Sep 3, 2023

    @jliexpensify
    Contributor

    @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:

    image

    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.

  5. 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
  6. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Sep 3, 2023
  7. 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
  8. melvin-bot commented on Sep 3, 2023

    @melvin-bot
  9. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Sep 3, 2023
  10. melvin-bot commented on Sep 3, 2023

    @melvin-bot

    Current assignee @jliexpensify is eligible for the External assigner, not assigning anyone new.

  11. melvin-bot commented on Sep 3, 2023

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @sobitneupane (External)

  12. AmjedNazzal commented on Sep 4, 2023

    @AmjedNazzal
    Contributor

    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.

    function isAnonymousUser() {
        return !lodashGet(credentials, 'login') && !lodashGet(credentials, 'validateCode');
    }

    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.

    function shouldDisableWriteActions(report) {
        const reportErrors = getAddWorkspaceRoomOrChatReportErrors(report);
        return isArchivedRoom .. || Session.isAnonymousUser(); // Changing from local variable to calling Session component
    }

    Result

    Screen.Recording.2023-09-04.at.3.16.19.AM.mov
  13. 22 remaining items

  14. sobitneupane commented on Sep 26, 2023

    @sobitneupane
    Contributor

    @pradeepmdk I don't think we need to raise PR here. I will be raised in the associated issue for which PR was raised.

  15. pradeepmdk commented on Sep 26, 2023

    @pradeepmdk
    Contributor

    @sobitneupane this issue was solved only when we upgraded React native Onyx version 1.0.89.

  16. sobitneupane commented on Sep 27, 2023

    @sobitneupane
    Contributor

    We will wait for it to update from the associated issue.

  17. pradeepmdk commented on Sep 27, 2023

    @pradeepmdk
    Contributor

    @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

  18. pradeepmdk commented on Sep 28, 2023

    @pradeepmdk
    Contributor

    @sobitneupane this is fixed now.

  19. jliexpensify commented on Oct 6, 2023

    @jliexpensify
    Contributor

    @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.

  20. jliexpensify commented on Oct 6, 2023

    @jliexpensify
    Contributor

    Payment Summary

    Upworks Job

  21. 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
  22. added
    Awaiting PaymentAuto-added when associated PR is deployed to production
    and removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Oct 6, 2023
  23. jliexpensify commented on Oct 6, 2023

    @jliexpensify
    Contributor

    Paid, job closed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorWeeklyKSv2

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions