Skip to content

Fix startup error spam: empty point list during initialization#36

Open
ravz wants to merge 1 commit intomasterfrom
fix/startup-empty-pointlist-error
Open

Fix startup error spam: empty point list during initialization#36
ravz wants to merge 1 commit intomasterfrom
fix/startup-empty-pointlist-error

Conversation

@ravz
Copy link
Collaborator

@ravz ravz commented Feb 7, 2026

Summary

  • buildJsonObject() now returns early instead of throwing when a device has no points yet — this is a normal transient state on startup, not an error
  • Added a cacheLoaded guard so scheduled queryDevices/buildJsonTree tasks wait until readCachedFile() completes before running
  • Applied the same guard in reinitializeClient() which has the same scheduled task pattern

Fixes #34

Test plan

  • Start Node-RED with cached BACnet devices — console should no longer show "Unable to build network tree, empty point list" errors
  • Verify devices still populate in the Read node UI tree after startup
  • Verify point polling works normally after the initial discovery period
  • Test with cache file disabled — behaviour should be unchanged

On Node-RED startup, buildJsonTree() could fire before the cache file
finished loading, causing repeated "Unable to build network tree, empty
point list" errors in the console. Two changes:

1. buildJsonObject() now returns early instead of throwing when a device
   has no points yet — this is a normal transient state, not an error.

2. Added a cacheLoaded guard so scheduled queryDevices/buildJsonTree
   tasks wait until readCachedFile() completes before running.

Fixes #34
@ravz ravz force-pushed the fix/startup-empty-pointlist-error branch from 3f8ebf1 to 68b09f6 Compare February 7, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BACnet Error: Error while building json object: Error: Unable to build network tree, empty point list

1 participant