fix: remove over-aggressive phone filter from related records matching #159
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "issue-158-related-records-anon-phone-filter"
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?
Fixes #158
Problem
The phone filter in
addMatchingReport(added as part of the fix for #149 / PR #151) was applied to ALL matching paths — name-based AND address-based. This caused anonymous compliance reports (with no reporter phone) to never appear as related records, even when they share a valid, complete address.Eli's test case: submitted a compliance report from RMO with an address in the Delta boundary, comments, but no reporter name/email/phone. The communication appeared in sync.nidus.cloud with no related records.
Fix
Remove the blanket
ReporterPhone == ""filter fromaddMatchingReport. The existing path-level guards are sufficient:isCompleteAddress()ensures the address has a real GID or full component fields before matchingReporterName != ""The real fix for #149 was (1) the
isCompleteAddressguard on the address path and (2) the early-return inpublicReportUpdateAddressIDwhen both GID and Raw are empty. The blanket phone filter was unnecessary and broke legitimate anonymous report matching.62af5cd537476ab8b6b2476ab8b6b20c3ae479bbCI was failing because the branch was accidentally created from a feature branch (
fix/issue-140-ci-submodule-build) instead ofmain. The commit ended up as an orphan (no parent), makinggo vetfail.Fix: Recreated branch from
main, cherry-picked just the one-line fix, and force-pushed. Proper diff now: 1 insertion, 4 deletions inplatform/communication.go.CI should re-trigger automatically on the push.