-
Notifications
You must be signed in to change notification settings - Fork 246
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
Follow an ignore/unignore user event with an initial sync #1703
Comments
I just spent a few hours trying to figure out why ignore lists were seemingly wrong after calling I'm happy to work on this, but am not sure where exactly to start; would appreciate some pointers. On a related note, I also feel that it's unfortunate and inefficient that the matrix_sdk_ui's |
…uired afterwards, but there is no way to currently do that in the Matrix SDK. So, while the logic for sending the (un)ignore request and handling the response are all correct, the timelines get completely cleared and we don't yet know how to re-establish them (perform that full sync). There is a related GitHub issue here, but it has been stagnant for a long time: <matrix-org/matrix-rust-sdk#1703> Relevant message from the Matrix SDK chat room: <https://matrix.to/#/!qSsPTKDfMGYqhgiLPJ:flipdot.org/$hCVXmEJh4EvbT2puuSxuv4rgnzXbQ6R07NJyT6VVwKQ?via=flipdot.org&via=matrix.org&via=element.io>
Indeed, modulo it's happening in the event cache now. So, when ignoring a user, we could do slightly better by removing only events from the ignored users in all the rooms we know about, and that would avoid the full flush. But when unignoring a user, we don't quite have a choice, because we don't which rooms may include events from the unignored user, only the server may tell us that. |
True, that's fair. In general, needing to clear all the timeline caches is okay, but I need a way to actually tell the Client or SlidingSync instance to re-fetch everything. Any ideas on how to do that? |
So there's no way to do that in the client, as far as I know (except if you restart the sync completely, after dropping all the local caches, etc.). On the other hand, you can do it a room granularity level, using back-pagination: the server will properly filter out events from ignored users, in that case. |
oh that's a clever idea! Thanks, I didn't think about using pagination; I'll give it a shot. |
update: it works well, thanks @bnjbvr! Note that I'd still be interested in helping to fix this issue within the SDK itself; I'm just not sure where to begin. |
Nice! I think the way to go here would be to have the event cache automatically trigger back-pagination (as it then remembers the events that have been back-paginated, so re-opening a previously-cleared room will include the back-paginated events). However, we cannot do this at scale: imagine a user with 4000 rooms ignoring another user; this would trigger lots and lots of back-paginations, and because of the lack of persistent storage for the event cache (#3280), all those back-pagination results would be lost after an app restart. Nevertheless: implementing some kind of support for "automatic", background back-pagination is one step along the way. The idea is that a room event cache could decide to trigger back-pagination on its own, while right now, this requires a manual function call through an API. This would probably require having an optional tokio task |
TODO is here:
matrix-rust-sdk/crates/matrix-sdk/src/account.rs
Line 814 in 09fc258
The text was updated successfully, but these errors were encountered: