mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 20:45:00 -05:00
Clearing a card's members/assignees over the REST API left the field uneditable in the UI. The card PUT handler guarded with `if (req.body.members)` — falsy for the natural clear payloads (null and "") — so removing the last member was a silent no-op, and its string branch wrote null instead of []; a card with members:null then breaks UI code that treats it as an array. The handler now uses an `!== undefined` guard plus a shared coercion helper so any clear payload (null / "" / []) stores a clean String[] (never null), a single id is wrapped into an array, and stray non-string entries are dropped. getMembers()/getAssignees() also coerce a legacy null to [] on read, healing existing corrupted documents. Pure logic in models/lib/restArrayParam.js with a Meteor-free Node unit test (tests/restArrayParam.test.cjs, incl. a negative test reproducing the old null-writing logic) wired into `npm run test:unit:node`, plus a REST regression in tests/playwright/specs/17-rest-api.e2e.js. Changelog: documents #3697 and moves #2292 (archive-swimlane) to verified-resolved (archive() does not delete cards; restore brings them back). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>