forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 69d4295dd558b3b2b267ec4b040ae0effce52e37Filtered to tests/partial_patch_users.rsClear filter

2026-07-30

feat: 🎨 sync the accent color like theme and languageAhmet Kaan Gümüş · 9490623
feat: 🎨 sync the accent color like theme and language

The frontend's palette picker kept the chosen accent in localStorage, so
it never followed the user to another device. `palette_color` joins
`theme` and `language` as a third per-user preference: a nullable hex
color on the user row, self-managed and admin-editable through the same
two PATCH routes, `null` until chosen.

The value set is deliberately open — any `#rrggbb` — rather than an enum
of the frontend's palette entries, so adding a palette is a frontend-only
change. Mixed case is accepted and stored lowercase, which is why
`/limits` publishes the accept-set pattern (`^#[0-9a-fA-F]{6}$`) and not
the storage form: a client validating its own input against the published
regex has to agree with the server, and a test now compiles that regex
and runs it over the validator's own accept/reject examples.

2026-07-25

fix: 🧩 finish the partial-PATCH sweep — 4 more handlers lost writesAhmet Kaan Gümüş · d773e7e
fix: 🧩 finish the partial-PATCH sweep — 4 more handlers lost writes

32bca26 routed six resources through `FieldUpdate` so a PATCH writes only
the fields it was given. It stopped at six of ten. The remaining four
still read the row unguarded and then wrote a field-scoped `SET` bound to
that stale snapshot, so two concurrent PATCHes of different fields
reverted each other, 200 OK, silently:

- subjects and the two user routes (`apply_profile`/`apply_preferences`,
  four endpoints) move to `FieldUpdate`. No lock needed — neither has a
  cross-field check, so request-scoped values alone close it
- course sessions get `SESSION_LOCK`, taken *before* the row read
  whenever `starts_at`/`ends_at` arrives, with the range merged and
  revalidated against the stored other end. The lock is not optional:
  converting to `FieldUpdate` without it re-introduces 9e25e0c, verified
  by disabling it and watching a one-ended PATCH store
  `starts_at > ends_at` with both requests answering 200
- bank questions instead take `BANK_LOCK.write()` before `owned_question`.
  This one is a genuine read-modify-write — the kind/choices/correct
  trio must merge from the stored row because choice ids carry the option
  pictures — so an exclusive lease over read+merge+write is the fix, the
  same shape as the exam PATCH. Per-field writes cannot express it
- `subject.rs` also mints ids via `monotonic_id::next_ulid()` now, since
  subjects list `ORDER BY id ASC`; `bank_questions.rs` rustdoc stops
  calling a choice id a position

Also verified safe and left alone: the exam and exam-question PATCHes
already hold `EXAM_LOCK.write()` across read and write, settings uses a
CAS retry, and messages/chatbot/questions/appointments write single
fields.

Each new suite races 20 rounds and reads the row back; every one fails if
the stale refill is restored.