Skip to content

Saving a group changes only the fields sent - #930

Open
edwh wants to merge 1 commit into
developfrom
group-partial-updates
Open

edwh wants to merge 1 commit into
developfrom
group-partial-updates

Conversation

@edwh

@edwh edwh commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Split out of #917, which is now only about the postcode.

Summary

  • Before: saving a group through the API overwrote every field with whatever the request sent, and blanked any field it didn't send. Sending just a phone number wiped the group's name, location, map position, description, website, timezone, email and network data.
  • This hit the Archive action. Archiving re-sent the whole group from the browser, and that saved the network data as the text "[object Object]".
  • After: saving a group changes only the fields the request sends. Changing the location still updates the map position and country to match.
  • Archiving now sends only the archive date.
  • Timezones: when a group's timezone changes, its future events are moved to the new timezone. Before, a request that didn't mention the timezone counted as changing it to nothing. Now only a request that actually sends a different timezone moves the events.

Code Quality Review

  • The change is in updateGroupv2. Admin- and coordinator-only fields (area, postcode, archive date) follow the same rule: they're only updated when sent.
  • The edit form still sends every field, so editing a group works as before.

Test Plan

  • PHPUnit: a host updating just the phone number leaves every other field, and future events' timezone, unchanged.
  • PHPUnit: archiving with only the date keeps the group's name and network data.
  • Jest: the Archive action sends only the group id and archive date.
  • CI

- updateGroupv2 updates only the fields present in the request (location
  brings its geocoded lat/lng/country with it). A partial update previously
  blanked everything else: e.g. sending just phone wiped the name, location,
  coordinates, description, website, timezone, email and network_data.
- A future-event timezone change only happens when timezone is sent;
  omitting it no longer counts as a change to null.
- The Archive group action sends only {id, archived_at}. It sent the whole
  store group back, which saved network_data as "[object Object]".

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@edwh edwh mentioned this pull request Oct 1, 2026
2 of 3 tasks
@sonarqubecloud

sonarqubecloud Bot commented Oct 1, 2026

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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