Removed fallback logic for gaia id logging (#2761)
This commit is contained in:
parent
505a5d617b
commit
f19b9ed4f8
|
@ -28,21 +28,19 @@ describe('user_id', () => {
|
||||||
|
|
||||||
expect(result).toBeDefined();
|
expect(result).toBeDefined();
|
||||||
expect(typeof result).toBe('string');
|
expect(typeof result).toBe('string');
|
||||||
expect(result.length).toBeGreaterThan(0);
|
|
||||||
|
|
||||||
// Should be consistent on subsequent calls
|
// Should be consistent on subsequent calls
|
||||||
const secondCall = getObfuscatedGoogleAccountId();
|
const secondCall = getObfuscatedGoogleAccountId();
|
||||||
expect(secondCall).toBe(result);
|
expect(secondCall).toBe(result);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should return the same as installation ID when no Google Account ID is cached', () => {
|
it('should return empty string when no Google Account ID is cached', () => {
|
||||||
// In a clean test environment, there should be no cached Google Account ID
|
// In a clean test environment, there should be no cached Google Account ID
|
||||||
// so getObfuscatedGoogleAccountId should fall back to installation ID
|
// so getObfuscatedGoogleAccountId should fall back to installation ID
|
||||||
const googleAccountIdResult = getObfuscatedGoogleAccountId();
|
const googleAccountIdResult = getObfuscatedGoogleAccountId();
|
||||||
const installationIdResult = getInstallationId();
|
|
||||||
|
|
||||||
// They should be the same when no Google Account ID is cached
|
// They should be the same when no Google Account ID is cached
|
||||||
expect(googleAccountIdResult).toBe(installationIdResult);
|
expect(googleAccountIdResult).toBe('');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -73,9 +73,8 @@ export function getObfuscatedGoogleAccountId(): string {
|
||||||
return googleAccountId;
|
return googleAccountId;
|
||||||
}
|
}
|
||||||
} catch (_error) {
|
} catch (_error) {
|
||||||
// If there's any error accessing Google Account ID, fall back to installation ID
|
// If there's any error accessing Google Account ID, just return empty string
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fall back to installation ID when no Google Account ID is cached or on error
|
return '';
|
||||||
return getInstallationId();
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue