Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to Sheaf are documented here. The format is based on [Keep a

### Fixed

- **Clearing a member's custom field now works from the web app.** Emptying a field and saving silently kept the old value: the web skipped empty fields from the save request entirely, and the server only touches the entries it is given, so nothing ever asked it to clear. The same skip also meant a ticked yes/no field could never be unticked, and a multiselect could never be emptied back to nothing. An emptied field that has a stored value is now sent as an explicit clear. (This is the web sibling of the Android clear-a-field bug; each client tripped over the same endpoint in its own way.)
- **Clearing a member's custom field no longer fails with some client libraries.** Clearing a field is expressed as `value: null` on `PUT /v1/members/{id}/fields` - but several client serialisers omit null fields entirely rather than writing them (the Android app's JSON library does this, which is how clearing a field from Android broke), and the server rejected an entry with no `value` at all. An omitted `value` is now accepted and clears the field exactly like an explicit null. Absence has no other meaning on this endpoint, so nothing changes for any client that already sends the null.
- **Front-change notifications with hidden co-fronters no longer say "and" twice.** A switch like five members starting with two of them hidden from the channel rendered "A, B, and C, and 2 others started fronting" - the visible names were joined into a finished list and the "N others" tail then bolted on with its own "and". The tail now joins the same list as the names, so the "and" lands exactly once, before the true final item: "A, B, C, and 2 others started fronting."

Expand Down
14 changes: 13 additions & 1 deletion web/src/routes/members.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,19 @@ function MemberFieldValues({ memberId }: { memberId: string }) {
? []
: "";
const val = effectiveValue(f.id, fallback);
if (isEmptyValue(f.field_type, val)) continue;
if (isEmptyValue(f.field_type, val)) {
// An emptied field still needs SAYING when the server holds a value
// for it: the endpoint only upserts the entries it is given, so
// skipping the entry entirely means "leave it as it was" and the
// field could never be cleared (nor a stored-true boolean unticked,
// nor a multiselect emptied). An explicit null clears it, and works
// against every deployed server version. A field the server has no
// row for stays skipped - there is nothing to clear.
if (f.id in serverValues) {
payload.push({ field_id: f.id, value: null });
}
continue;
}
payload.push({ field_id: f.id, value: valueForWire(f.field_type, val) });
}
setValues.mutate(
Expand Down
Loading