Skip to content

Commit 3c5607a

Browse files
authored
fix(logs): remove support for number (NangoHQ#2523)
## Describe your changes Fixes https://linear.app/nango/issue/NAN-1448/remove-number-from-activitylogid - Activity log id has been `string` for the last 2 months now
1 parent 822c766 commit 3c5607a

File tree

19 files changed

+37
-79
lines changed

19 files changed

+37
-79
lines changed

packages/cli/lib/services/__snapshots__/model.service.unit.test.ts.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ export interface NangoProps {
233233
connectionId: string;
234234
environmentId: number;
235235
environmentName?: string;
236-
activityLogId?: number | string | undefined;
236+
activityLogId?: string | undefined;
237237
providerConfigKey: string;
238238
provider?: string;
239239
lastSyncDate?: Date;
@@ -266,7 +266,7 @@ export declare class NangoAction {
266266
protected nango: Nango;
267267
private attributes;
268268
protected persistApi: AxiosInstance;
269-
activityLogId?: number | string | undefined;
269+
activityLogId?: string | undefined;
270270
syncId?: string;
271271
nangoConnectionId?: number;
272272
environmentId: number;

packages/jobs/lib/integration.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { logContextGetter } from '@nangohq/logs';
88

99
interface ScriptObject {
1010
runner: Runner;
11-
activityLogId: number | undefined;
11+
activityLogId: string | undefined;
1212
cancelled?: boolean;
1313
}
1414

packages/node-client/lib/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class Nango {
5757
providerConfigKey?: string;
5858
isSync = false;
5959
dryRun = false;
60-
activityLogId?: number | string | undefined;
60+
activityLogId?: string | undefined;
6161
userAgent: string;
6262
http: AxiosInstance;
6363

packages/node-client/lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export interface NangoProps {
6161
providerConfigKey?: string;
6262
isSync?: boolean;
6363
dryRun?: boolean;
64-
activityLogId?: number | string | undefined;
64+
activityLogId?: string | undefined;
6565
}
6666

6767
export interface CreateConnectionOAuth1 extends OAuth1Credentials {

packages/orchestrator/lib/clients/client.integration.test.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ describe('OrchestratorClient', async () => {
167167
provider_config_key: 'P',
168168
environment_id: 456
169169
},
170-
activityLogId: 789,
170+
activityLogId: '789',
171171
input: { foo: 'bar' }
172172
}
173173
});
@@ -204,7 +204,7 @@ describe('OrchestratorClient', async () => {
204204
provider_config_key: 'P',
205205
environment_id: 5678
206206
},
207-
activityLogId: 9876,
207+
activityLogId: '9876',
208208
input: { foo: 'bar' }
209209
}
210210
});
@@ -235,7 +235,7 @@ describe('OrchestratorClient', async () => {
235235
provider_config_key: 'P',
236236
environment_id: 5678
237237
},
238-
activityLogId: 9876,
238+
activityLogId: '9876',
239239
input: { foo: 'bar' }
240240
}
241241
});
@@ -272,7 +272,7 @@ describe('OrchestratorClient', async () => {
272272
provider_config_key: 'P',
273273
environment_id: 5678
274274
},
275-
activityLogId: 9876,
275+
activityLogId: '9876',
276276
input: { foo: 'bar' }
277277
}
278278
});
@@ -304,7 +304,7 @@ describe('OrchestratorClient', async () => {
304304
provider_config_key: 'P',
305305
environment_id: 5678
306306
},
307-
activityLogId: 9876,
307+
activityLogId: '9876',
308308
input: { foo: 'bar' }
309309
}
310310
});
@@ -334,7 +334,7 @@ describe('OrchestratorClient', async () => {
334334
provider_config_key: 'P',
335335
environment_id: 456
336336
},
337-
activityLogId: 789,
337+
activityLogId: '789',
338338
input: { foo: 'bar' }
339339
}
340340
});
@@ -360,7 +360,7 @@ describe('OrchestratorClient', async () => {
360360
provider_config_key: 'P',
361361
environment_id: 456
362362
},
363-
activityLogId: 789,
363+
activityLogId: '789',
364364
input: { foo: 'bar' }
365365
}
366366
});
@@ -378,7 +378,7 @@ describe('OrchestratorClient', async () => {
378378
provider_config_key: 'P',
379379
environment_id: 456
380380
},
381-
activityLogId: 789,
381+
activityLogId: '789',
382382
input: { foo: 'bar' }
383383
}
384384
});
@@ -409,7 +409,7 @@ describe('OrchestratorClient', async () => {
409409
provider_config_key: 'P',
410410
environment_id: 456
411411
},
412-
activityLogId: 789,
412+
activityLogId: '789',
413413
input: { foo: 'bar' }
414414
}
415415
});
@@ -428,7 +428,7 @@ describe('OrchestratorClient', async () => {
428428
provider_config_key: 'P',
429429
environment_id: 456
430430
},
431-
activityLogId: 789,
431+
activityLogId: '789',
432432
input: { foo: 'bar' }
433433
}
434434
});

packages/orchestrator/lib/clients/processor.integration.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ async function immediateTask({ groupKey }: { groupKey: string }) {
124124
heartbeatTimeoutSecs: 30,
125125
payload: {
126126
type: 'action',
127-
activityLogId: 1234,
127+
activityLogId: '1234',
128128
actionName: 'Task',
129129
connection: {
130130
id: 1234,

packages/orchestrator/lib/clients/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface ActionArgs {
2727
environment_id: number;
2828
connection_id: string;
2929
};
30-
activityLogId: string | number;
30+
activityLogId: string;
3131
input: JsonValue;
3232
}
3333
interface WebhookArgs {
@@ -39,7 +39,7 @@ interface WebhookArgs {
3939
provider_config_key: string;
4040
environment_id: number;
4141
};
42-
activityLogId: string | number;
42+
activityLogId: string;
4343
input: JsonValue;
4444
}
4545

@@ -53,7 +53,7 @@ interface PostConnectionArgs {
5353
};
5454
version: string;
5555
fileLocation: string;
56-
activityLogId: string | number;
56+
activityLogId: string;
5757
}
5858
export type SchedulesReturn = Result<OrchestratorSchedule[]>;
5959
export type VoidReturn = Result<void, ClientError>;

packages/orchestrator/lib/clients/validate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ export const syncArgsSchema = z.object({
2727
export const actionArgsSchema = z.object({
2828
type: z.literal('action'),
2929
actionName: z.string().min(1),
30-
activityLogId: z.union([z.number(), z.string()]),
30+
activityLogId: z.string(),
3131
input: jsonSchema,
3232
...commonSchemaArgsFields
3333
});
3434
export const webhookArgsSchema = z.object({
3535
type: z.literal('webhook'),
3636
webhookName: z.string().min(1),
3737
parentSyncName: z.string().min(1),
38-
activityLogId: z.union([z.number(), z.string()]),
38+
activityLogId: z.string(),
3939
input: jsonSchema,
4040
...commonSchemaArgsFields
4141
});
@@ -44,7 +44,7 @@ export const postConnectionArgsSchema = z.object({
4444
postConnectionName: z.string().min(1),
4545
version: z.string().min(1),
4646
fileLocation: z.string().min(1),
47-
activityLogId: z.union([z.number(), z.string()]),
47+
activityLogId: z.string(),
4848
...commonSchemaArgsFields
4949
});
5050

packages/persist/lib/controllers/persist.controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type RecordRequest = Request<
2323
records: Record<string, any>[];
2424
providerConfigKey: string;
2525
connectionId: string;
26-
activityLogId: number | string;
26+
activityLogId: string;
2727
},
2828
void
2929
>;
@@ -32,7 +32,7 @@ const MAX_LOG_CHAR = 10000;
3232

3333
class PersistController {
3434
public async saveLog(
35-
req: Request<{ environmentId: number }, void, { activityLogId: number | string; level: LegacyLogLevel; msg: string; timestamp?: number }, void>,
35+
req: Request<{ environmentId: number }, void, { activityLogId: string; level: LegacyLogLevel; msg: string; timestamp?: number }, void>,
3636
res: Response,
3737
next: NextFunction
3838
) {
@@ -168,7 +168,7 @@ class PersistController {
168168
syncJobId: number;
169169
model: string;
170170
records: Record<string, any>[];
171-
activityLogId: number | string;
171+
activityLogId: string;
172172
softDelete: boolean;
173173
persistFunction: (records: FormattedRecord[]) => Promise<Result<UpsertSummary>>;
174174
}): Promise<Result<void>> {

packages/persist/lib/server.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ server.post(
3232
}),
3333
body: z
3434
.object({
35-
activityLogId: z.union([z.number(), z.string()]),
35+
activityLogId: z.string(),
3636
level: z.enum(['info', 'debug', 'error', 'warn', 'http', 'verbose', 'silly']),
3737
msg: z.string(),
3838
timestamp: z.number().optional() // Optional until fully deployed
@@ -54,7 +54,7 @@ const validateRecordsRequest = validateRequest({
5454
records: z.array(z.object({ id: z.union([z.string().max(255).min(1), z.number()]) })).nonempty(),
5555
providerConfigKey: z.string(),
5656
connectionId: z.string(),
57-
activityLogId: z.union([z.number(), z.string()])
57+
activityLogId: z.string()
5858
})
5959
});
6060
const recordPath = '/environment/:environmentId/connection/:nangoConnectionId/sync/:syncId/job/:syncJobId/records';

0 commit comments

Comments
 (0)