Skip to content

[HOLD #34289] [$2000] The app crashes when the user is logged into multiple tabs and logs out of one of the tabs #15321

Closed

Description

@techievivek

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:

  • Open newDot in 2 different tabs.
  • Log out from one of the tabs and observe that in other tab you can see the app crashes.

Screen.Recording.2023-02-21.at.9.54.21.PM.mov

Expected Result:

The user should have been logged out in the other tab

Actual Result:

The app actually crashes.

Workaround:

No workaround and this needs to be fixed ASAP.

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: v1.2.74-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
Expensify/Expensify Issue URL:
Issue reported by: @hungvu193
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1674651616948819, https://expensify.slack.com/archives/C9YU7BX5M/p1676990369948349

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016764b6d950f13143
  • Upwork Job ID: 1628628211642437632
  • Last Price Increase: 2023-04-12

Activity

  1. added
    Daily
    Bug
    on Feb 21, 2023
  2. locked and limited conversation to collaborators on Feb 21, 2023
  3. MelvinBot commented on Feb 21, 2023

    @MelvinBot
    Contributor

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

  4. MelvinBot commented on Feb 21, 2023

    @MelvinBot
    Contributor

    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
  5. MelvinBot commented on Feb 22, 2023

    @MelvinBot
    Contributor

    Triggered auto assignment to @roryabraham (Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.

  6. johncschuster commented on Feb 22, 2023

    @johncschuster
    Contributor

    Hm... I may have jumped the gun here. I just tried reproducing the behavior in an incognito window, and was not able to reproduce it.

    @techievivek, what am I doing wrong here?

    2023-02-22_15-57-10.mp4
  7. roryabraham commented on Feb 23, 2023

    @roryabraham
    Contributor

    @johncschuster The problem is probably that you were using an incognito window, so the other site is not sharing the same IndexedDB database. When we have the site running in multiple non-incognito tabs, those tabs are both sharing the same data. The same is not true when the site is running in a normal window and in an incognito window. That's why if you're signed in in a normal window and open the site in a new tab, it will pop right up. But if you open it in an incognito window, you'll have to log in again.

  8. added
    External
    on Feb 23, 2023
  9. unlocked this conversation on Feb 23, 2023
  10. changed the title [-]The app crashes when the user is logged into multiple tabs and logs out of one of the tabs[/-] [+][$1000] The app crashes when the user is logged into multiple tabs and logs out of one of the tabs[/+] on Feb 23, 2023
  11. MelvinBot commented on Feb 23, 2023

    @MelvinBot
    Contributor
  12. 278 remaining items

  13. changed the title [-][$2000] The app crashes when the user is logged into multiple tabs and logs out of one of the tabs[/-] [+][HOLD] [$2000] The app crashes when the user is logged into multiple tabs and logs out of one of the tabs[/+] on Jan 24, 2024
  14. roryabraham commented on Jan 24, 2024

    @roryabraham
    Contributor

    Putting this on HOLD for #34289. One idea that's maybe crazy or maybe just makes sense is to use bedrock to synchronize SQLite across tabs. I'm really not too sure how the data is shared between tabs in SQLite or how it might need to be replicated.

    I think using leader election to ensure that only one tab is doing writes makes sense at a high level, not sure what went wrong with out implementation because it was pretty thoroughly tested. Maybe when adding it to E/App we left the old ActiveClientManager in place and the two were conflicting with eachother?

  15. kacper-mikolajczak commented on Jan 24, 2024

    @kacper-mikolajczak
    Contributor

    It's not 100% clear to me if SQLite-wasm will fix the multi-tab concurrency issues, but it feels like maybe it could. Do multiple tabs share the same database? This seems like something we can discuss further with SQLite and try to get a solid plan for.

    For keeping the database synchronised, we could create a single instance of it in separate context (e.g. Worker) as a single source of truth and then access it from multiple tabs. I am not sure if SharedWorker API is sufficient for our needs.

    It would be cool to have the sync layer OOTB with SQLite.wasm, but let me know what you think of above as kind of an alternative 👍

    CC: @roryabraham @chrispader

  16. koko57 commented on Jan 24, 2024

    @koko57
    Contributor

    Maybe when adding it to E/App we left the old ActiveClientManager in place and the two were conflicting with each other?

    No, unfortunately it wasn't that. Even with applying ActiveClientManager from Onyx the issues are still reproducible.

  17. chrispader commented on Jan 25, 2024

    @chrispader
    Contributor

    I gave an update on the SQLite WASM idea in #34289 (comment).

    I'm currently also investigating if the extra worker thread could be directly used to sync multiple tabs, or if we need an extra worker or some other logic to keep tabs in sync...

  18. added and removed
    Weekly
    on Feb 16, 2024
  19. melvin-bot commented on Feb 16, 2024

    @melvin-bot

    This issue has not been updated in over 15 days. @trjExpensify, @sobitneupane, @koko57, @roryabraham, @tienifr eroding to Monthly issue.

    P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

  20. changed the title [-][HOLD] [$2000] The app crashes when the user is logged into multiple tabs and logs out of one of the tabs[/-] [+][HOLD #34289] [$2000] The app crashes when the user is logged into multiple tabs and logs out of one of the tabs[/+] on Feb 16, 2024
  21. trjExpensify commented on Feb 16, 2024

    @trjExpensify
    Contributor

    Still held, Melv.

  22. melvin-bot commented on Apr 15, 2024

    @melvin-bot

    @trjExpensify, @sobitneupane, @koko57, @roryabraham, @tienifr, this Monthly task hasn't been acted upon in 6 weeks; closing.

    If you disagree, feel encouraged to reopen it -- but pick your least important issue to close instead.

  23. roryabraham commented on Apr 15, 2024

    @roryabraham
    Contributor

    This issue this was on HOLD for was closed as not planned for now. Not sure if multi-tab support is worth fixing now or if we should just leave this as closed

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

Metadata

Metadata

Labels

EngineeringExternalMonthlyNewFeatureNot a priorityReviewing

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions