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

🐛(backend) compute ancestor_links in get_abilities if needed #725

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

lunika
Copy link
Member

@lunika lunika commented Mar 15, 2025

Purpose

The refactor made in the tree view caching the ancestors_links to not compute them again in the document.get_abilities method lead to a bug. If the get_abilities method is called without ancestors_links, then they are computes on all the ancestors but not from the highest readable ancestor for the current user. We have to compute them with this constraints and to avoid to compute it again and again we save the result in a cache.

Proposal

  • compute ancestor_links in get_abilities if needed

@lunika lunika added the bug Something isn't working label Mar 15, 2025
@lunika lunika requested a review from sampaccoud March 15, 2025 11:38
@lunika lunika self-assigned this Mar 15, 2025
@lunika lunika requested a review from qbey March 21, 2025 12:48
@lunika lunika force-pushed the fix/compute_ancestors_links branch from 12f33cd to 294b88b Compare March 21, 2025 12:59
@lunika lunika force-pushed the fix/compute_ancestors_links branch from 294b88b to 557e6d5 Compare March 24, 2025 09:47
@lunika lunika requested a review from sampaccoud March 24, 2025 09:47
@lunika lunika force-pushed the fix/compute_ancestors_links branch from 557e6d5 to cf486d0 Compare March 24, 2025 09:48
Copy link
Member

@qbey qbey left a comment

Choose a reason for hiding this comment

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

I think there is a way to reduce the amount of queries for the retrieve endpoint, but it would require much time.

The refactor made in the tree view caching the ancestors_links to not
compute them again in the document.get_abilities method lead to a bug.
If the get_abilities method is called without ancestors_links, then they
are computed on all the ancestors but not from the highest readable
ancestor for the current user. We have to compute them with this
constraint.
@lunika lunika force-pushed the fix/compute_ancestors_links branch from cf486d0 to ae97d2e Compare March 24, 2025 12:51
@lunika lunika enabled auto-merge (rebase) March 24, 2025 12:51
@lunika lunika merged commit a1914c6 into main Mar 24, 2025
19 checks passed
@lunika lunika deleted the fix/compute_ancestors_links branch March 24, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants