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

Stop Member Re-Evaluation when a permission is modified (or any other modification that would update members) #5115

Closed
jrainville opened this issue May 6, 2024 · 2 comments

Comments

@jrainville
Copy link
Member

Problem

Currently, the member re-evaluation always goes to completion, even if it would become expired by some other modifications made to a community.

Examples of what would trigger the re-evaluation:

  • CreateCommunityTokenPermission
  • EditCommunityTokenPermission
  • DeleteCommunityTokenPermission
  • Periodic reevaluation every hour
  • Manual call to the API

Each of then could make the previous run superfluous.

Implementation

The solution is to stop any previous re-evaluation when a new one is called to be started.
This will first of all reduce the number of requests we do and also ensure that we do not save an old community description by accident (since the re-evaluation is done in a different thread, it takes a snapshot of the community description at the start of its procedure).

I don't know how to do it technically in Go, but the goal would be to stop the previous procedure completely and just run the new one.

Acceptance Criteria

  • When a permission is modified, the previous re-evaluation is stopped
  • A new re-evaluation is started with the up to date community description

Future Steps

One further improvement we could do is to make the community saving smarter for the re-evaluation so that it merges the community description it has with a possibly more recent community description, but that requires a very smart algorithm to merge the changes correctly.

@osmaczko
Copy link
Contributor

Currently, the member re-evaluation always goes to completion, even if it would become expired by some other modifications made to a community.

In theory it should not be possible as reevaluation locks the community. For instance, EditCommunityTokenPermission will wait until current reevaluation is done.

@jrainville
Copy link
Member Author

Closing as after discussion, it's not that needed

@jrainville jrainville closed this as not planned Won't fix, can't repro, duplicate, stale May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

2 participants