fix: remove over-aggressive phone filter from related records matching #159

Merged
eliribble merged 1 commit from issue-158-related-records-anon-phone-filter into main 2026-07-22 23:08:24 +00:00
Member

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 from addMatchingReport. The existing path-level guards are sufficient:

  • Address path: isCompleteAddress() ensures the address has a real GID or full component fields before matching
  • Name path: the caller only queries by name when ReporterName != ""

The real fix for #149 was (1) the isCompleteAddress guard on the address path and (2) the early-return in publicReportUpdateAddressID when both GID and Raw are empty. The blanket phone filter was unnecessary and broke legitimate anonymous report matching.

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 from `addMatchingReport`. The existing path-level guards are sufficient: - **Address path:** `isCompleteAddress()` ensures the address has a real GID or full component fields before matching - **Name path:** the caller only queries by name when `ReporterName != ""` The real fix for #149 was (1) the `isCompleteAddress` guard on the address path and (2) the early-return in `publicReportUpdateAddressID` when both GID and Raw are empty. The blanket phone filter was unnecessary and broke legitimate anonymous report matching.
ned force-pushed issue-158-related-records-anon-phone-filter from 62af5cd537
Some checks failed
/ golint (push) Successful in 1m52s
/ pnpm-build (push) Failing after 3s
to 476ab8b6b2
Some checks failed
/ golint (push) Successful in 19s
/ pnpm-build (push) Failing after 2s
2026-07-22 23:02:39 +00:00
Compare
ned force-pushed issue-158-related-records-anon-phone-filter from 476ab8b6b2
Some checks failed
/ golint (push) Successful in 19s
/ pnpm-build (push) Failing after 2s
to 0c3ae479bb
Some checks failed
/ golint (push) Successful in 19s
/ pnpm-build (push) Failing after 3s
2026-07-22 23:05:12 +00:00
Compare
Author
Member

CI was failing because the branch was accidentally created from a feature branch (fix/issue-140-ci-submodule-build) instead of main. The commit ended up as an orphan (no parent), making go vet fail.

Fix: Recreated branch from main, cherry-picked just the one-line fix, and force-pushed. Proper diff now: 1 insertion, 4 deletions in platform/communication.go.

CI should re-trigger automatically on the push.

**CI was failing** because the branch was accidentally created from a feature branch (`fix/issue-140-ci-submodule-build`) instead of `main`. The commit ended up as an orphan (no parent), making `go vet` fail. **Fix:** Recreated branch from `main`, cherry-picked just the one-line fix, and force-pushed. Proper diff now: 1 insertion, 4 deletions in `platform/communication.go`. CI should re-trigger automatically on the push.
eliribble approved these changes 2026-07-22 23:08:18 +00:00
eliribble deleted branch issue-158-related-records-anon-phone-filter 2026-07-22 23:08:24 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Gleipnir/nidus-sync!159
No description provided.