No compliance report attached to communication #158
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
I just tested the compliance flow from RMO in staging. I created a report with an address within the Delta boundary. I included comments on the report. The report flow looked fine, no errors. I did not include a reporter name, email address, or phone number as part of the report. After submission, a communication object did correctly show up in the sync.nidus.cloud UI. However, it was missing any related reports. There should have been one related report, even though it was fully anonymous, since it included a location and basic information.
I think this was broken recently as part of the fix for #149. Please take a look.
Confirmed — this was broken by the fix for #149. The root cause is in
CommunicationRelatedRecords.How it broke
The fix for #149 (PR #151) added an
addMatchingReporthelper function with a blanket filter:This filter was applied to ALL matching paths — both name-based and address-based. When an anonymous compliance report (no reporter name/email/phone) is submitted via RMO,
CommunicationRelatedRecordsenters the address path, finds other reports at the same address, but then filters every one of them out because they all have emptyReporterPhone.Why it's wrong
The phone filter was meant to prevent over-matching in the #149 scenario, but the actual fixes for that issue were:
isCompleteAddress()on the address path — ensures the address has real GID or full components before matchingpublicReportUpdateAddressIDwhen both GID and Raw are empty — prevents grabbing whatever random address with gid=''Both of these are sufficient guards. The blanket phone filter is unnecessary and actively breaks legitimate address-based matching for anonymous reports.
Fix
PR #159 removes the
ReporterPhone == ""check fromaddMatchingReport. The dedup logic is preserved. Address-based matching now correctly relates anonymous reports that share a complete address.#159