test: update recurrence expansion test + fix TS/Lint errors
This commit is contained in:
@@ -456,8 +456,8 @@ describe('expandRecurringEvents', () => {
|
||||
recurrenceRules: [rule({ '@type': 'RecurrenceRule', frequency: 'daily' })],
|
||||
});
|
||||
const result = expand(event, '2025-01-06T00:00:00', '2025-01-08T00:00:00');
|
||||
expect(result[0].id).toBe('evt1:2025-01-06T09:00:00');
|
||||
expect(result[1].id).toBe('evt1:2025-01-07T09:00:00');
|
||||
expect(result[0].id).toBe('evt1::occurrence::2025-01-06T09:00:00');
|
||||
expect(result[1].id).toBe('evt1::occurrence::2025-01-07T09:00:00');
|
||||
});
|
||||
|
||||
it('preserves originalId pointing to master', () => {
|
||||
|
||||
+3
-2
@@ -6096,6 +6096,7 @@ export class JMAPClient implements IJMAPClient {
|
||||
private wsReconnectAttempts: number = 0;
|
||||
private wsConsecutiveFailures: number = 0;
|
||||
private wsPermanentlyDisabled: boolean = false;
|
||||
private _statesPromise: Promise<void> | null = null;
|
||||
private wsHeartbeatTimer: NodeJS.Timeout | null = null;
|
||||
private lastWSActivity: number = 0;
|
||||
|
||||
@@ -6177,7 +6178,7 @@ export class JMAPClient implements IJMAPClient {
|
||||
// entirely: SSE only streams changes from the moment it connects
|
||||
// onward (no catch-up on connect), so the one thing that CAN catch up
|
||||
// is a diff against a state snapshot taken before the gap started.
|
||||
void this.fetchCurrentStates();
|
||||
this._statesPromise = this.fetchCurrentStates();
|
||||
// Not confirmed either way whether this server's WebSocket push fans
|
||||
// out to shared/secondary accounts or, like Stalwart's SSE, covers the
|
||||
// primary account only - keep the same secondary poll running under
|
||||
@@ -6321,7 +6322,7 @@ export class JMAPClient implements IJMAPClient {
|
||||
* original 31s-worst-case ladder did.
|
||||
*/
|
||||
private async reconcileAfterWebSocketFallback(): Promise<void> {
|
||||
await this._stateSnapshotPromise;
|
||||
await this._statesPromise;
|
||||
await this.checkForStateChanges();
|
||||
|
||||
const eventSourceUrl = this.getEventSourceUrl();
|
||||
|
||||
@@ -800,6 +800,7 @@ export interface StateChange {
|
||||
Calendar?: string;
|
||||
CalendarEvent?: string;
|
||||
SieveScript?: string;
|
||||
FileNode?: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ export async function exchangeCodeForTokens(
|
||||
const tokens = await tokenResponse.json();
|
||||
|
||||
if (!tokens.access_token) {
|
||||
const { access_token, refresh_token, ...safeTokens } = tokens;
|
||||
const { access_token: _at, refresh_token: _rt, ...safeTokens } = tokens;
|
||||
logger.error('Token response missing access_token', { response: JSON.stringify(safeTokens).substring(0, 500) });
|
||||
throw new Error('Invalid token response');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user