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

Archived rooms should not be cleared before receiving a sync #2020

Open
1 task done
Clemens-Toegel opened this issue Feb 5, 2025 · 0 comments
Open
1 task done

Archived rooms should not be cleared before receiving a sync #2020

Clemens-Toegel opened this issue Feb 5, 2025 · 0 comments

Comments

@Clemens-Toegel
Copy link
Contributor

Preflight Checklist

  • I could not find a solution in the existing issues, docs, nor discussions

Describe your problem

In the loadArchiveWithTimeline method _archivedRooms.clear() is called in the beginning of the function. This may lead to unwanted side effects. For example, when the client is online and loads its state correctly including archived rooms. Then, we will go offline with our client and call loadArchiveWithTimeline() again. This will clear all the archived rooms, and will try to do a sync, but the sync will fail because it can't establish a connection to the homeserver. Now, I have lost the archived rooms until I get online again.

See:

_archivedRooms.clear();

Describe your ideal solution

I would suggest to put the _archivedRooms.clear() call after the sync, so that we will delete the old state only if the sync was successful.

Version

0.37

Security requirements

No response

Additional Context

No response

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

No branches or pull requests

1 participant