fix: Fix multiple bugs with new authentication flow

This commit is contained in:
2026-06-07 15:04:21 +02:00
parent 9fc26b1ccf
commit 83456c018c
137 changed files with 4710 additions and 281 deletions

View File

@@ -0,0 +1,38 @@
import { mapComponentNameToDomain } from './domain-mapping.rules';
export interface SuspectedComponentLeak {
name: string;
count: number;
expected: number;
}
export function aggregateComponentCountsByDomain(
componentCounts: Record<string, number>
): Record<string, number> {
const domains: Record<string, number> = {};
for (const [componentName, count] of Object.entries(componentCounts)) {
const domain = mapComponentNameToDomain(componentName);
domains[domain] = (domains[domain] ?? 0) + count;
}
return domains;
}
export function detectSuspectedComponentLeaks(
componentCounts: Record<string, number>,
expectedCounts: Record<string, number>
): SuspectedComponentLeak[] {
const leaks: SuspectedComponentLeak[] = [];
for (const [name, count] of Object.entries(componentCounts)) {
const expected = expectedCounts[name] ?? 0;
if (count > expected) {
leaks.push({ name, count, expected });
}
}
return leaks.sort((left, right) => right.count - left.count);
}