Skip to content

UNS ingester can't handle BigInts #535

@amrc-benmorrow

Description

@amrc-benmorrow

The UNS ingester is choking on BigInts. I'm not sure where they're coming from, I though the Sparkplug libraries decoded to Longs, but maybe it's pulling in my function which translates? Either way this will need handling with a custom JSON encoder function, probably.

[13:24:04.757] INFO (ACS UNS Ingester Sparkplug/7): 👶 Received birth certificate for XXX/XXX/XXX with Instance_UUID YYY using Schema_UUID ZZZ
file:///home/node/app/lib/mqttclient.js:398
            this.sparkplugBroker.publish(topic, JSON.stringify(payload), {
                                                     ^

TypeError: Do not know how to serialize a BigInt
    at JSON.stringify (<anonymous>)
    at file:///home/node/app/lib/mqttclient.js:398:54
    at Array.forEach (<anonymous>)
    at MQTTClient.publishToUNS (file:///home/node/app/lib/mqttclient.js:364:42)
    at MQTTClient.onMessage (file:///home/node/app/lib/mqttclient.js:224:22)
    at MqttClient.emit (node:events:518:28)
    at handlePublish (/home/node/app/node_modules/mqtt/build/lib/handlers/publish.js:97:20)
    at handle (/home/node/app/node_modules/mqtt/build/lib/handlers/index.js:28:35)
    at work (/home/node/app/node_modules/mqtt/build/lib/client.js:237:40)
    at process.processTicksAndRejections (node:internal/process/task_queues:85:11)

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions