fix: refresh suggestion cache entry on derivations update #384
No reviewers
Labels
No labels
automation
backend
bug
contributor experience
data
deployment
documentation
duplicate
good first issue
help wanted
nice to have
notifications
package maintainer
performance
skin
tech debt
user story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-community/nix-security-tracker#384
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Couldn't sleep with having this problem in my head.
I had to switch the arguments for the update_or_create function because they were wrong: The proposal_id is used for the lookup and the payload is then used on update.
This is going to make updates very slow, but doesn't affect page load and I'd argue that it is important to have correct behaviour at first. With https://github.com/Nix-Security-WG/nix-security-tracker/pull/383 merged update times wouldn't even be noticable.
This should be done triggered async, otherwise we'll have to wait a long time. Right now it's also done every time, even if pkgs are not updated.
I looked into that more seriously, I don't think triggering a recaching is the good approach here.
For one, this will trigger a weird experience where you will see temporarily (in case of heavy loads) the view non-sync with what's going on.
Recaching should be reserved for expensive transformations that are hard to re-express on their cached variants.
In this instance, there's only one operation: filtering out derivations from the payload.
This should be expressible in one SQL query which should not involve back'n'forth with Python. I have some local prototype I'm working on where I can do this sort of stuff.
Are you suggesting something like storing a flag for the filtered-out derivations, but somewhere outside the actual suggestion entry (since that is cached)?
This is now ready.
Rebased.
The rebase broke displaying derivations.
OK this is beyond my paygrade, I do see the derivations threaded in some templates but I don't understand what's going on, can you weigh in @erictapen (whenever you are available ofc)?
In the meantime, fix #396 as intended in principle.
This also breaks state change display, setting it to draft for now.
Fixed!
Tested, works. Displaying pages in the "selected" view for some reason is much slower than in the "suggestions" view, which doesn't make much sense to me, but we'll deal with that another time.