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

Delete Events from ignored users and trigger a clear cache request dialog when unignoring user(s) #5772

Merged
merged 10 commits into from
Apr 21, 2022

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented Apr 15, 2022

Ignoring users

When users is ignored, all the Timeline Events from this user are deleted from the database.

The only remaining issue is that the timeline has to be reloaded for the change to take effect. Related (but not really closing it): #1899. Handled in 903e226

Closing #1899

Unignoring user

When users are unignored, an initial sync has to be performed. Current code warn the user and perform an initial sync.

This PR handle the case where users are unignored from another session.

So:

  • The warnings about an initial sync when unignoring a user has been removed
  • A dialog is displayed when a user is unignored. This information is coming from the sync, so it can be a consequence of unignoring locally of from another session.
  • It's possible to does the init sync later, so several users can be unignored without having to perform an init sync for each user.

The dialog looks like:

image

@bmarty bmarty changed the title Trigger an clear cache request dialog when unignoring user(s) Delete Events from ignored userrs and trigger an clear cache request dialog when unignoring user(s) Apr 15, 2022
@github-actions
Copy link

github-actions bot commented Apr 15, 2022

Unit Test Results

114 files  ±0  114 suites  ±0   1m 10s ⏱️ -9s
202 tests ±0  202 ✔️ ±0  0 💤 ±0  0 ±0 
678 runs  ±0  678 ✔️ ±0  0 💤 ±0  0 ±0 

Results for commit 903e226. ± Comparison against base commit 3b454b9.

♻️ This comment has been updated with latest results.

@bmarty
Copy link
Member Author

bmarty commented Apr 15, 2022

Assigned to @ariskotsomitopoulos manually, since you have reviewed the previous PR #5767 and this PR reverts part of the previous change.

@bmarty bmarty changed the title Delete Events from ignored userrs and trigger an clear cache request dialog when unignoring user(s) Delete Events from ignored users and trigger a clear cache request dialog when unignoring user(s) Apr 15, 2022
…gnoring a user, for the change to take effect
Copy link
Contributor

@ariskotsomitopoulos ariskotsomitopoulos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, approved, I didn't run the code. Just a minor comment

// See https://spec.matrix.org/latest/client-server-api/#client-behaviour-22 :
// "Once ignored, the client will no longer receive events sent by that user, with the exception of state events"
// So just delete all non-state events from our local storage.
realm.where(TimelineEventEntity::class.java)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be better to extract this functionality in TimelineEventEntityQueries.kt or TimelineEventHelper.kt. Not a blocker

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Will be handled in a dedicated PR later.

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

Successfully merging this pull request may close these issues.

2 participants