Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

test: scope Google API timeout contract to Calendar clients now that Gmail uses gmailApi (#12219)

[._.]/ Adam Eivy7a6bdea799fd
diff --git a/server/services/googleApiTimeout.test.js b/server/services/googleApiTimeout.test.js
index e1be77b5a5..904c43db9c 100644
--- a/server/services/googleApiTimeout.test.js
+++ b/server/services/googleApiTimeout.test.js
@@ -3,22 +3,20 @@ import { describe, expect, it } from 'vitest';
import { GOOGLE_API_TIMEOUT_MS } from './googleAuth.js';
const serviceFiles = [
- 'messageGmailSync.js',
- 'messageActions.js',
'calendarGoogleApiSync.js',
'goalCalendarScheduler.js',
];
describe('Google API client request timeout', () => {
- it('sets the shared deadline on every Gmail and Calendar service client', () => {
+ it('sets the shared deadline on every Calendar service client (Gmail goes through gmailApi.js)', () => {
const constructors = serviceFiles.flatMap(file => {
const source = readFileSync(new URL(`./${file}`, import.meta.url), 'utf8');
- return [...source.matchAll(/\b(?:gmail|calendar)\(\s*\{[^}]*\}\s*\)/gs)]
+ return [...source.matchAll(/\bcalendar\(\s*\{[^}]*\}\s*\)/gs)]
.map(([construction]) => ({ file, construction }));
});
expect(GOOGLE_API_TIMEOUT_MS).toBe(30_000);
- expect(constructors).toHaveLength(8);
+ expect(constructors).toHaveLength(4);
for (const { file, construction } of constructors) {
expect(construction, file).toContain('timeout: GOOGLE_API_TIMEOUT_MS');
}
@@ -26,6 +24,6 @@ describe('Google API client request timeout', () => {
it('keeps the shorter Gmail reply-metadata request override', () => {
const source = readFileSync(new URL('./messageGmailSync.js', import.meta.url), 'utf8');
- expect(source).toMatch(/metadata\s*=\s*await gmailClient\.users\.messages\.get\([\s\S]*?\},\s*\{ timeout: 10_000, retry: false \}\)/);
+ expect(source).toMatch(/gmailClient\.getMessage\([\s\S]*?\},\s*\{ timeout: 10_000, retry: false \}\)/);
});
});