ReleaseDeduplicationService class

Service responsible for identifying duplicate AppReleaseItems, scoring their completeness to determine the canonical record, merging user interactions/metadata, and executing a complete cascading purge across all related Firestore collections.

Constructors

ReleaseDeduplicationService()
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

areLikelyDuplicates(AppReleaseItem a, AppReleaseItem b, {int timeThresholdMs = 120000}) → bool
Determines if two AppReleaseItems appear to be duplicates based on owner, media URLs, title slug, and creation timestamp.
calculateCompletenessScore(AppReleaseItem item) → int
Calculates a completeness and quality score for an AppReleaseItem. Higher score means the item is more complete, valid, and rich in metadata.
deduplicateList(List<AppReleaseItem> items) → List<AppReleaseItem>
In-memory deduplication: given a list of AppReleaseItems, returns a clean list containing only the canonical item for each duplicate group, with merged metadata.
groupDuplicates(Iterable<AppReleaseItem> items) → Map<String, List<AppReleaseItem>>
Groups items by normalized key and filters to only clusters with duplicates (> 1 item).
mergeMetadata(AppReleaseItem canonical, AppReleaseItem duplicate) → bool
Merges engagement, interactions and missing metadata from duplicate into canonical.
normalizeKey(AppReleaseItem item) → String
Generates a normalized deduplication key for an AppReleaseItem. Items sharing the same key are candidates for deduplication.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
purgeDuplicate(AppReleaseItem duplicate, AppReleaseItem canonical) → Future<bool>
Purges a single duplicate AppReleaseItem and removes all its cascading references.
runAutomatedDeduplication({bool dryRun = false}) → Future<int>
Scans all releases in Firestore, detects duplicates, and executes automated cleanup. Returns the number of purged duplicate items.
selectCanonicalItem(List<AppReleaseItem> duplicates) → AppReleaseItem
Selects the canonical item from a list of duplicate AppReleaseItems. The canonical item is the one with the highest completeness score. If tied, prefers the older item (earliest createdTime).
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited