From 12ae076907e8405460308a32d807a7cacad121f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89mile=20R=C3=A9?= Date: Fri, 15 May 2026 11:10:31 +0400 Subject: [PATCH] Clean up tracker mapping worker MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove redundant resolveThirdParty fallback that re-attempted resolution with the same inputs, and rename LoadCommonThirdPartyIDByTrackerPatternID to LoadCommonThirdPartyIDByDomainMatch to reflect that it joins on initiator_domain. Signed-off-by: Émile Ré --- pkg/coredata/detected_tracker.go | 2 +- pkg/probo/tracker_mapping_worker.go | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/pkg/coredata/detected_tracker.go b/pkg/coredata/detected_tracker.go index a381b2095..f3e1d7975 100644 --- a/pkg/coredata/detected_tracker.go +++ b/pkg/coredata/detected_tracker.go @@ -152,7 +152,7 @@ WHERE return count, nil } -func (dts *DetectedTrackers) LoadCommonThirdPartyIDByTrackerPatternID( +func (dts *DetectedTrackers) LoadCommonThirdPartyIDByDomainMatch( ctx context.Context, conn pg.Querier, trackerPatternID gid.GID, diff --git a/pkg/probo/tracker_mapping_worker.go b/pkg/probo/tracker_mapping_worker.go index 93d49675b..ec6a03c29 100644 --- a/pkg/probo/tracker_mapping_worker.go +++ b/pkg/probo/tracker_mapping_worker.go @@ -85,13 +85,6 @@ func (h *trackerMappingHandler) Process(ctx context.Context, tp coredata.Tracker commonPatternID, thirdPartyID = h.matchByDomain(ctx, tx, tp) } - if commonPatternID != nil && thirdPartyID == nil { - var cp coredata.CommonTrackerPattern - if err := cp.LoadByID(ctx, tx, *commonPatternID); err == nil { - thirdPartyID = h.resolveThirdParty(ctx, tx, tp, &cp) - } - } - if commonPatternID != nil || thirdPartyID != nil { if err := tp.UpdateMapping(ctx, tx, commonPatternID, thirdPartyID); err != nil { return fmt.Errorf("cannot update tracker pattern mapping: %w", err) @@ -137,7 +130,7 @@ func (h *trackerMappingHandler) matchByDomain( tp coredata.TrackerPattern, ) (*gid.GID, *gid.GID) { var trackers coredata.DetectedTrackers - commonThirdPartyID, err := trackers.LoadCommonThirdPartyIDByTrackerPatternID(ctx, tx, tp.ID) + commonThirdPartyID, err := trackers.LoadCommonThirdPartyIDByDomainMatch(ctx, tx, tp.ID) if err != nil { h.logger.ErrorCtx(ctx, "cannot load common third party ID from domain", log.Error(err)) return nil, nil