fix: guard publicReportUpdateAddressID against empty GID+Raw #151
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-149-publicreport-address-guard"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When the frontend submits an address update with both GID and Raw empty (e.g., user clicked the map and continued before the async reverse geocode completed, or the reverse geocode failed), the else branch in
publicReportUpdateAddressIDfalls through to:On organization 1 this matches address 68 (the first address inserted with
gid = ''), which was likely created during early development/MVCAC demos. The result: every report submitted through the door-hanger (district) path with an incomplete address gets attached to this same address, causing the unrelated-reports issue Alysia reported.Fix: Add an early return guard at the top of
publicReportUpdateAddressIDwhen both GID and Raw are empty. No address data to set, so leave the report's address_id unchanged.See issue #149 comment for the full root-cause analysis.