Skip to content

Commit 4011dd4

Browse files
staticoclaude
andcommitted
v1.6.1
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent b8045e1 commit 4011dd4

4 files changed

Lines changed: 34 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@meshtastic/cli-viewer",
3-
"version": "1.6.0",
3+
"version": "1.6.1",
44
"type": "module",
55
"scripts": {
66
"dev": "bun run src/index.ts",

src/index.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,26 @@ process.on("uncaughtException", (error) => {
5959

6060
process.on("unhandledRejection", (reason) => {
6161
logError("UNHANDLED REJECTION", reason);
62+
console.error("Unhandled promise rejection:", reason);
63+
process.exit(1);
64+
});
65+
66+
process.on("SIGTERM", () => {
67+
logError("SIGTERM", new Error("Received SIGTERM"));
68+
Logger.shutdown();
69+
process.exit(0);
70+
});
71+
72+
process.on("SIGINT", () => {
73+
logError("SIGINT", new Error("Received SIGINT"));
74+
Logger.shutdown();
75+
process.exit(0);
76+
});
77+
78+
process.on("SIGHUP", () => {
79+
logError("SIGHUP", new Error("Received SIGHUP"));
80+
Logger.shutdown();
81+
process.exit(0);
6282
});
6383

6484
// Parse CLI arguments
@@ -70,7 +90,7 @@ let session = "default";
7090
let clearSession = false;
7191
let meshViewUrl: string | undefined;
7292
let useFahrenheit = false;
73-
let enableLogging = false;
93+
let enableLogging = true;
7494
let packetLimit = 50000;
7595

7696
for (let i = 0; i < args.length; i++) {

src/transport/http.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@ export class HttpTransport implements Transport {
4141
}
4242

4343
private async poll() {
44+
let iterationCount = 0;
4445
while (this.running) {
4546
try {
47+
iterationCount++;
48+
// Heartbeat every 60 iterations (~3 minutes at 3s per iteration)
49+
if (iterationCount % 60 === 0) {
50+
Logger.info("HttpTransport", `Poll heartbeat: ${iterationCount} iterations`);
51+
}
4652
// Drain available packets with a small delay between each
4753
let gotPacket = true;
4854
let batchCount = 0;

src/ui/App.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -839,6 +839,12 @@ export function App({ address, packetStore, nodeStore, skipConfig = false, skipN
839839
}
840840
}
841841
}
842+
// Log when transport loop exits normally
843+
Logger.warn("App", "Transport loop exited", { running });
844+
if (running) {
845+
console.error("CRITICAL: Transport iterator completed unexpectedly while running=true");
846+
Logger.error("App", "TRANSPORT_LOOP_EXIT: Transport loop exited while running=true", new Error("Transport loop exited"));
847+
}
842848
} catch (error) {
843849
Logger.error("App", "Transport reading loop error", error as Error);
844850
if (running) {

0 commit comments

Comments
 (0)