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
[HOLD #34289] [$2000] The app crashes when the user is logged into multiple tabs and logs out of one of the tabs #15321
@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.
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
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
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?
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 👍
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...
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!
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
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
Activity
MelvinBot commentedon Feb 21, 2023
Triggered auto assignment to @johncschuster (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.MelvinBot commentedon Feb 21, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)MelvinBot commentedon Feb 22, 2023
Triggered auto assignment to @roryabraham (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.johncschuster commentedon Feb 22, 2023
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
roryabraham commentedon Feb 23, 2023
@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.
[-]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[/+]MelvinBot commentedon Feb 23, 2023
Job added to Upwork: https://www.upwork.com/jobs/~016764b6d950f13143
278 remaining items
[-][$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[/+]roryabraham commentedon Jan 24, 2024
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?
kacper-mikolajczak commentedon Jan 24, 2024
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 APIis 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
koko57 commentedon Jan 24, 2024
No, unfortunately it wasn't that. Even with applying ActiveClientManager from Onyx the issues are still reproducible.
chrispader commentedon Jan 25, 2024
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...
melvin-bot commentedon Feb 16, 2024
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!
[-][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[/+]trjExpensify commentedon Feb 16, 2024
Still held, Melv.
melvin-bot commentedon Apr 15, 2024
@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.
roryabraham commentedon Apr 15, 2024
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