target-supabase-sdk 0.2.8 → 0.2.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "target-supabase-sdk",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "Supabase client initializer and data access APIs",
5
5
  "license": "MIT",
6
6
  "author": "KyLoc20",
@@ -422,7 +422,8 @@ abstract class BaseNodeRuntime {
422
422
  }
423
423
 
424
424
  this.consecutiveHeartbeatFailures = 0;
425
- logger.info("心跳更新成功", {
425
+ // Success is the steady state every loop — do not INFO-spam; failures already warn/critical.
426
+ logger.debug("心跳更新成功", {
426
427
  topic: LOG_TOPIC_NODE,
427
428
  data: { lastHeartBeat: formatHeartbeat(lastHeartBeat) },
428
429
  });
@@ -441,15 +442,26 @@ abstract class BaseNodeRuntime {
441
442
  });
442
443
 
443
444
  cmdLogger.debug("開始檢查控制指令", { topic: LOG_TOPIC_COMMAND });
444
- const { data: commandList = [], error: pollError } = await getPollCommandList({
445
- nodeId,
446
- traceId: loopTraceId,
447
- size: MAX_POLL_TARGET_LIST_SIZE,
448
- });
449
- if (pollError) {
445
+ let commandList: Awaited<ReturnType<typeof getPollCommandList>>["data"] = [];
446
+ try {
447
+ const polled = await getPollCommandList({
448
+ nodeId,
449
+ traceId: loopTraceId,
450
+ size: MAX_POLL_TARGET_LIST_SIZE,
451
+ });
452
+ if (polled.error) {
453
+ cmdLogger.warn("獲取指令失敗", {
454
+ topic: LOG_TOPIC_COMMAND,
455
+ data: { error: polled.error.message },
456
+ });
457
+ return;
458
+ }
459
+ commandList = polled.data ?? [];
460
+ } catch (error) {
461
+ // pollTargetList throws on transport/DB failures — treat as soft miss, not loop CRITICAL.
450
462
  cmdLogger.warn("獲取指令失敗", {
451
463
  topic: LOG_TOPIC_COMMAND,
452
- data: { error: pollError.message },
464
+ data: { error: getErrorMessage(error) },
453
465
  });
454
466
  return;
455
467
  }