Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node18 updates and Timer -> Timeout change #1788

Merged
merged 4 commits into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/1788.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixup types for Timers so the bridge works with newer node versions.
2 changes: 1 addition & 1 deletion src/irc/BridgedClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ export class BridgedClient extends EventEmitter {
private connectDefer: promiseutil.Defer<void>;
public readonly log: BridgedClientLogger;
private cachedOperatorNicksInfo: {[channel: string]: GetNicksResponseOperators} = {};
private idleTimeout: NodeJS.Timer|null = null;
private idleTimeout: NodeJS.Timeout|null = null;
private whoisPendingNicks: Set<string> = new Set();
private state: State = {
status: BridgedClientStatus.CREATED
Expand Down
4 changes: 2 additions & 2 deletions src/irc/ConnectionInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ export class IRCConnectionError extends Error {
export class ConnectionInstance {
public dead = false;
private state: "created"|"connecting"|"connected" = "created";
private pingRateTimerId: NodeJS.Timer|null = null;
private clientSidePingTimeoutTimerId: NodeJS.Timer|null = null;
private pingRateTimerId: NodeJS.Timeout|null = null;
private clientSidePingTimeoutTimerId: NodeJS.Timeout|null = null;
// eslint-disable-next-line no-use-before-define
private connectDefer: Defer<ConnectionInstance>;
public onDisconnect?: (reason: string) => void;
Expand Down
2 changes: 1 addition & 1 deletion src/pool-service/CommandReader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export class RedisCommandReader {
private shouldRun = true;
private commandStreamId = "$"
private supportsMinId = false;
private trimInterval?: NodeJS.Timer;
private trimInterval?: NodeJS.Timeout;

constructor(
private readonly redis: Redis,
Expand Down
2 changes: 1 addition & 1 deletion src/pool-service/IrcConnectionPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class IrcConnectionPool {
private commandStreamId = "$";
private metricsServer?: Server;
private shouldRun = true;
private heartbeatTimer?: NodeJS.Timer;
private heartbeatTimer?: NodeJS.Timeout;
private readonly commandReader: RedisCommandReader;

constructor(private readonly config: typeof Config) {
Expand Down
2 changes: 1 addition & 1 deletion src/pool-service/IrcPoolClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export class IrcPoolClient extends (EventEmitter as unknown as new () => TypedEm
private readonly connections = new Map<ClientId, Promise<RedisIrcConnection>>();
public shouldRun = true;
private missedHeartbeats = 0;
private heartbeatInterval?: NodeJS.Timer;
private heartbeatInterval?: NodeJS.Timeout;
private commandReader: RedisCommandReader;
cmdReader: Redis;

Expand Down
2 changes: 2 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
"useUnknownInCatchVariables": false,
/* matrix-js-sdk throws up errors */
"skipLibCheck": true,
"module": "Node16",
"moduleResolution": "Node16"
},
"include": [
"src/**/*"
Expand Down
Loading