fix: resolve lint warnings/errors and apply formatting (#1024)
* fix: resolve lint warnings/errors and apply formatting Fix 10 oxlint issues (2 errors, 8 warnings): - Remove unused catch parameters in Security.tsx and ImportDialog.tsx - Remove stray expression in Generator.tsx - Add eslint-disable for debounced useCallback in FilterControl.tsx - Remove unnecessary deps (resolveDB, store) in bindStoreToDevice.ts - Prefix unused variant param in AppSidebar.tsx - Memoize tabs arrays in DeviceConfig, RadioConfig, ModuleConfig - Fix channels type in RadioConfig TabItem Also applies oxfmt formatting across all files. * updating lock file * update protobuf package * fix: regenerate pnpm-lock.yaml and exclude jsr protobufs from minimumReleaseAge * prevented http card from always being polled * updated pnpm config fiile * updated actions * removed biome config and lint system leftovers * updating protobuf package
This commit is contained in:
@@ -16,8 +16,7 @@ export class TransportNode implements Types.Transport {
|
||||
private socket: Socket | undefined;
|
||||
private pipePromise?: Promise<void>;
|
||||
private abortController: AbortController;
|
||||
private lastStatus: Types.DeviceStatusEnum =
|
||||
Types.DeviceStatusEnum.DeviceDisconnected;
|
||||
private lastStatus: Types.DeviceStatusEnum = Types.DeviceStatusEnum.DeviceDisconnected;
|
||||
|
||||
private closingByUser = false;
|
||||
private errored = false;
|
||||
@@ -29,11 +28,7 @@ export class TransportNode implements Types.Transport {
|
||||
* @param timeout - TCP socket timeout in milliseconds (defaults to 60000).
|
||||
* @returns A promise that resolves with a connected TransportNode instance.
|
||||
*/
|
||||
public static create(
|
||||
hostname: string,
|
||||
port = 4403,
|
||||
timeout = 60000,
|
||||
): Promise<TransportNode> {
|
||||
public static create(hostname: string, port = 4403, timeout = 60000): Promise<TransportNode> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const socket = new Socket();
|
||||
|
||||
@@ -65,10 +60,7 @@ export class TransportNode implements Types.Transport {
|
||||
this.socket?.removeAllListeners();
|
||||
this.socket?.destroy();
|
||||
if (!this.closingByUser) {
|
||||
this.emitStatus(
|
||||
Types.DeviceStatusEnum.DeviceDisconnected,
|
||||
"socket-error",
|
||||
);
|
||||
this.emitStatus(Types.DeviceStatusEnum.DeviceDisconnected, "socket-error");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -82,10 +74,7 @@ export class TransportNode implements Types.Transport {
|
||||
});
|
||||
|
||||
this.socket.on("timeout", () => {
|
||||
this.emitStatus(
|
||||
Types.DeviceStatusEnum.DeviceDisconnected,
|
||||
"socket-timeout",
|
||||
);
|
||||
this.emitStatus(Types.DeviceStatusEnum.DeviceDisconnected, "socket-timeout");
|
||||
this.socket?.removeAllListeners();
|
||||
this.socket?.destroy();
|
||||
});
|
||||
@@ -94,18 +83,13 @@ export class TransportNode implements Types.Transport {
|
||||
if (this.closingByUser) {
|
||||
return; // suppress close-derived disconnect in user flow
|
||||
}
|
||||
this.emitStatus(
|
||||
Types.DeviceStatusEnum.DeviceDisconnected,
|
||||
"socket-closed",
|
||||
);
|
||||
this.emitStatus(Types.DeviceStatusEnum.DeviceDisconnected, "socket-closed");
|
||||
});
|
||||
|
||||
this.abortController = new AbortController();
|
||||
const abortController = this.abortController;
|
||||
|
||||
const fromDeviceSource = Readable.toWeb(
|
||||
connection,
|
||||
) as ReadableStream<Uint8Array>;
|
||||
const fromDeviceSource = Readable.toWeb(connection) as ReadableStream<Uint8Array>;
|
||||
const transformed = fromDeviceSource.pipeThrough(Utils.fromDeviceStream());
|
||||
|
||||
this._fromDevice = new ReadableStream<Types.DeviceOutput>({
|
||||
@@ -129,14 +113,9 @@ export class TransportNode implements Types.Transport {
|
||||
if (this.closingByUser || this.errored) {
|
||||
ctrl.close();
|
||||
} else {
|
||||
this.emitStatus(
|
||||
Types.DeviceStatusEnum.DeviceDisconnected,
|
||||
"read-error",
|
||||
);
|
||||
this.emitStatus(Types.DeviceStatusEnum.DeviceDisconnected, "read-error");
|
||||
|
||||
ctrl.error(
|
||||
error instanceof Error ? error : new Error(String(error)),
|
||||
);
|
||||
ctrl.error(error instanceof Error ? error : new Error(String(error)));
|
||||
}
|
||||
try {
|
||||
await transformed.cancel();
|
||||
|
||||
Reference in New Issue
Block a user