Skip to content
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

Discard fetches when the active, logged-in account has changed #5009

Open
gnprice opened this issue Sep 18, 2021 · 2 comments
Open

Discard fetches when the active, logged-in account has changed #5009

gnprice opened this issue Sep 18, 2021 · 2 comments
Labels
a-data-sync Zulip's event system, event queues, staleness/liveness a-multi-org P1 high-priority

Comments

@gnprice
Copy link
Member

gnprice commented Sep 18, 2021

When we go and fetch some data from the server, we should be sure to associate the resulting data with the right account, and not with some other of the user's accounts. In particular this should be the case even if the fetch took a while, and if in the interim the user went and switched to look at a different account (the new "active account".)

We'll need to solve this as part of #5005, where we'll potentially have several fetches going concurrently for several different accounts, and each will need to know which account the results should get stored under.

But pending that, in our current world where we have server data for just the one active account at a time, it'd be enough to discard the fetch's result (and ideally cancel the fetch itself, #4170) if the active account has changed by then.

Currently we do this in the event-queue long-polling loop in startEventPolling, which is the most important case, but not most other places -- notably, not in doInitialFetch registerAndStartPolling, or the various message-fetching actions in fetchActions.js.

Issues #4170 and #4659 cover parts of how we might do this.

Issue #3791 is basically an example symptom of this.

@gnprice gnprice added a-multi-org a-data-sync Zulip's event system, event queues, staleness/liveness P1 high-priority labels Sep 18, 2021
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Dec 8, 2021
…cceeds

And add a suggestion for what to do with the equality check on the
caller's queue ID and the in-state queue ID.

Fixes: zulip#5022
Related: zulip#5009
chrisbobbe added a commit to chrisbobbe/zulip-mobile that referenced this issue Mar 8, 2022
…cceeds

And add a suggestion for what to do with the equality check on the
caller's queue ID and the in-state queue ID.

Fixes: zulip#5022
Related: zulip#5009
@gnprice
Copy link
Member Author

gnprice commented Oct 6, 2022

We got a report today of what is probably this issue:
https://chat.zulip.org/#narrow/stream/48-mobile/topic/local.20cross-realm.20leakage.20issue/near/1444848

@chrisbobbe
Copy link
Contributor

chrisbobbe commented Dec 13, 2022

Any objection to changing the title from

Discard fetches when the active account has changed

to

Discard fetches when the active, logged-in account has changed

, since we probably want to cancel fetches when you log out the active account too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-data-sync Zulip's event system, event queues, staleness/liveness a-multi-org P1 high-priority
Projects
None yet
Development

No branches or pull requests

2 participants