From 3ad150450379fc0088e8ffae4b522cc878c0969f Mon Sep 17 00:00:00 2001 From: caviri <45425937+caviri@users.noreply.github.com> Date: Wed, 19 Aug 2026 00:15:32 +0200 Subject: [PATCH 1/3] fix(frontend): stop saving voting rules from silently unchecking own-team MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Rules form used a bare `use:enhance`, whose default success handler calls form.reset(). `checked={data.policy.ownTeamVoting}` sets the checkbox PROPERTY, never the defaultChecked ATTRIBUTE, so reset reverts every box to unchecked. `ownTeamVoting` defaults to checked and round-trips to the same value, so Svelte's fine-grained reactivity never re-asserts the property — the reset's uncheck sticks and the save looks like it turned the rule off. The data was saved correctly; only the display lied, and a second save from that state would have stored the false the organiser never chose. Uses the file's existing `keepValues` handler (update({ reset: false })), which keeps the invalidation that reflects genuine changes while dropping the destructive reset. --- .../(app)/my/hackathon/[id]/voting/+page.svelte | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/frontend/src/routes/(app)/my/hackathon/[id]/voting/+page.svelte b/components/frontend/src/routes/(app)/my/hackathon/[id]/voting/+page.svelte index 96bf0e60..dcb4737e 100644 --- a/components/frontend/src/routes/(app)/my/hackathon/[id]/voting/+page.svelte +++ b/components/frontend/src/routes/(app)/my/hackathon/[id]/voting/+page.svelte @@ -125,8 +125,16 @@ -
+ replaces the whole record. + + keepValues, not a bare use:enhance: checked={…} sets the + checkbox PROPERTY, never the defaultChecked attribute, so the + default form.reset() after a successful save reverts the boxes + to unchecked. ownTeamVoting defaults to checked and round-trips + to the same value, so Svelte's reactivity never re-asserts it — + the reset's uncheck sticks, and saving looks like it silently + turned the rule off. --> +

Rules