fix: undo action didn't work anymore #422
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#422
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-undo"
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?
also refactored update_suggestion, this method was never meant to only be called once
Fixes #421
Hm, this doesn't seem to fix it yet. The item only returns temporarily; on reload it's gone (and always stayed in the other state).
It should work now. It looks like, the undo action never really worked before? 😬
Two test engineers walk into a bar...
@ -529,0 +533,4 @@
# We only have to modify derivations when they are editable
if not (
self.status_filter == CVEDerivationClusterProposal.Status.REJECTED
or undo_status_change
Just a side note, not a blocker, and I didn't review it out when it was added, but: for all intents an purposes JS is stuff on top of Berners-Lee web, which is why it should add its own cludges, not remove those added to pre-emptively reserve space for client-side-scripted workflows.
@ -546,2 +587,4 @@
"suggestion": suggestion,
"activity_log": activity_log,
"status_filter": self.status_filter,
# This only matters in a non-JS environment
Why only here and not for the other stati? Or, why the
and undo_status_change
at all?@ -546,2 +587,4 @@
"suggestion": suggestion,
"activity_log": activity_log,
"status_filter": self.status_filter,
# This only matters in a non-JS environment
This ensures, that there is only one way back to the pending state: By clicking the undo button. So this is really only there for double-checking anyway, as there is currently no button to achieve this.
@ -529,0 +533,4 @@
# We only have to modify derivations when they are editable
if not (
self.status_filter == CVEDerivationClusterProposal.Status.REJECTED
or undo_status_change
The problem here is that you can't add form parameters specifically for the htmx request, you can only remove them. This is why there is this awkward no-js flag that is filtered out when using htmx.
@ -546,2 +587,4 @@
"suggestion": suggestion,
"activity_log": activity_log,
"status_filter": self.status_filter,
# This only matters in a non-JS environment
@ -546,2 +587,4 @@
"suggestion": suggestion,
"activity_log": activity_log,
"status_filter": self.status_filter,
# This only matters in a non-JS environment
Please always answer why-questions in comments, otherwise that knowledge will be lost, and eternal cargo cult ensues (severely exerbated by not having tests)
@ -546,2 +587,4 @@
"suggestion": suggestion,
"activity_log": activity_log,
"status_filter": self.status_filter,
# This only matters in a non-JS environment
Okay, makes sense, I will try to do that 👍
@ -529,0 +533,4 @@
# We only have to modify derivations when they are editable
if not (
self.status_filter == CVEDerivationClusterProposal.Status.REJECTED
or undo_status_change
Which is why it would make sense to have a separate endpoint. Doing something like
would circumvent all that noise entirely. htmx is absolutely beautiful.
And then we'd have an entirely separate, tidy code path just for the dynamic stuff.