Skip to content

Send an explicit null when clearing a custom field on the web - #277

Merged
SiteRelEnby merged 2 commits into
mainfrom
fix/web-clear-custom-field
Sep 7, 2026
Merged

SiteRelEnby merged 2 commits into
mainfrom
fix/web-clear-custom-field

Conversation

@SiteRelEnby

Copy link
Copy Markdown
Contributor

Fixes clearing a member's custom field from the web app, the web sibling of the Android clear-a-field bug (#274, backend fix, automerging).

Emptying a field and saving silently kept the old value: handleSave skipped empty editor values from the PUT payload entirely, and PUT /v1/members/{id}/fields only upserts the entries it is given, so the server was never asked to clear anything. The same skip meant a stored-true boolean field could never be unticked and a multiselect could never be emptied.

An emptied field is now sent as {field_id, value: null} when the server currently holds a value for it - an explicit clear that works against every deployed server version, independent of the #274 rollout. Fields the server has no row for stay skipped, so never-set fields do not accrue null rows.

For the record, the endpoint has now collected three distinct client failure shapes: explicit-null clients always worked, Android dropped the value key (422, fixed server-side in #274), and the web dropped the whole entry (silent no-op, fixed here).

tsc, eslint, and a production build are clean.

Emptying a member's custom field and saving silently kept the old
value: handleSave skipped empty editor values from the PUT payload
entirely, and the endpoint only upserts the entries it is given, so
the server was never asked to clear anything. The same skip meant a
stored-true boolean field could never be unticked and a multiselect
could never be emptied.

An emptied field is now pushed as {field_id, value: null} when the
server holds a value for it - an explicit clear that works against
every deployed server version, independent of the omitted-value
backend fix. Fields the server has no row for stay skipped, so
never-set fields do not accrue null rows.

Third client, third shape of the same endpoint bug: explicit-null
clients worked, Android dropped the value key (422, fixed server-side),
and the web dropped the whole entry (silent no-op, fixed here).
@SiteRelEnby
SiteRelEnby merged commit cc5a414 into main Sep 7, 2026
8 checks passed
@SiteRelEnby
SiteRelEnby deleted the fix/web-clear-custom-field branch September 7, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant