Skip to content

Commit e07e280

Browse files
committed
feat: DevRank Whitelist Synchronization & Protection (#9047)
1 parent 92ad68a commit e07e280

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

apps/devrank/services/Cleanup.mjs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ class Cleanup extends Base {
4545
const initialUserCount = users.length;
4646
const initialTrackerCount = tracker.length;
4747

48+
// 1.5. Sync Whitelist -> Tracker (Resurrection)
49+
// Ensure all whitelisted users are in the tracker so they get scheduled.
50+
whitelist.forEach(login => {
51+
const lowerLogin = login.toLowerCase();
52+
// Check if already in tracker (case-insensitive check needed, or rely on normalization)
53+
// Tracker is an array of objects.
54+
const exists = tracker.some(t => t.login.toLowerCase() === lowerLogin);
55+
56+
if (!exists && !blacklist.has(lowerLogin)) {
57+
console.log(`[Cleanup] Resurrecting whitelisted user: ${login}`);
58+
tracker.push({ login, lastUpdate: null });
59+
}
60+
});
61+
4862
// 2. Filter Users (Rich Data)
4963
// Criteria: Not Blacklisted AND (Threshold Met OR Whitelisted)
5064
users = users.filter(u => {
@@ -72,6 +86,7 @@ class Cleanup extends Base {
7286
const lowerLogin = t.login.toLowerCase();
7387

7488
if (blacklist.has(lowerLogin)) return false;
89+
if (whitelist.has(lowerLogin)) return true; // Explicit protection
7590

7691
// Optional: Also prune from tracker if we have rich data proving they are low value?
7792
// If we don't have rich data (yet), we keep them to be scanned.

0 commit comments

Comments
 (0)