MortJC / homebridge-platform-orbit

Orbit Irrigation System platform plugin for HomeBridge
MIT License
34 stars 5 forks source link

Converting circular structure to JSON error #37

Closed dxdc closed 3 years ago

dxdc commented 3 years ago

Traced the below error to this plugin.

1|homebrid | [8/15/2021, 10:42:47 PM] Your accessories will not persist between restarts until this issue is resolved.
1|homebrid | [8/15/2021, 10:42:47 PM] Failed to save cached accessories to disk: Converting circular structure to JSON
1|homebrid |     --> starting at object with constructor 'Timeout'
1|homebrid |     |     property '_idlePrev' -> object with constructor 'TimersList'
1|homebrid |     --- property '_idleNext' closes the circle

Didn't investigate where in the code this trips, but, see the below snippet in cachedAccessories file. Maybe relevant, but I normally leave my timer w/o batteries installed and the wifi unit is connected.

    "context": {
      "device": {
        "token": "xx,
        "id": "xx",
        "name": "bhyve_xx",
        "hardware_version": "HT25-0000",
        "firmware_version": "0041",
        "is_connected": true,
        "zones": [
          {
            "station": 1,
            "name": ""
          }
        ],
        "messageQueue": [],
        "rws": {
          "_listeners": {
            "error": [],
            "message": [],
            "open": [],
            "close": []
          },
          "_retryCount": 0,
          "_shouldReconnect": true,
          "_connectLock": false,
          "_binaryType": "blob",
          "_closeCalled": false,
          "_messageQueue": [],
          "_url": "wss://api.orbitbhyve.com/v1/events",
          "_protocols": [],
          "_options": {
            "connectionTimeout": 10000,
            "maxReconnectionDelay": 64000,
            "minReconnectionDelay": 2000,
            "reconnectionDelayGrowFactor": 2
          },
          "_ws": {
            "_events": {},
            "_eventsCount": 4,
            "_binaryType": "nodebuffer",
            "_closeCode": 1006,
            "_closeFrameReceived": false,
            "_closeFrameSent": false,
            "_closeMessage": "",
            "_closeTimer": null,
            "_extensions": {},
            "_protocol": "",
            "_readyState": 1,
            "_receiver": {
              "_writableState": {
                "objectMode": false,
                "highWaterMark": 16384,
                "finalCalled": false,
                "needDrain": false,
                "ending": false,
                "ended": false,
                "finished": false,
                "destroyed": false,
                "decodeStrings": true,
                "defaultEncoding": "utf8",
                "length": 0,
                "writing": false,
                "corked": 0,
                "sync": true,
                "bufferProcessing": false,
                "writecb": null,
                "writelen": 0,
                "afterWriteTickInfo": null,
                "bufferedRequest": null,
                "lastBufferedRequest": null,
                "pendingcb": 0,
                "prefinished": false,
                "errorEmitted": false,
                "emitClose": true,
                "autoDestroy": false,
                "bufferedRequestCount": 0,
                "corkedRequestsFree": {
                  "next": null,
                  "entry": null
                }
              },
              "writable": true,
              "_events": {},
              "_eventsCount": 6,
              "_binaryType": "nodebuffer",
              "_extensions": {},
              "_isServer": false,
              "_maxPayload": 104857600,
              "_bufferedBytes": 0,
              "_buffers": [],
              "_compressed": false,
              "_payloadLength": 0,
              "_fragmented": 0,
              "_masked": false,
              "_fin": false,
              "_opcode": 0,
              "_totalPayloadLength": 0,
              "_messageLength": 0,
              "_fragments": [],
              "_state": 0,
              "_loop": false
            },
            "_sender": {
              "_extensions": {},
              "_socket": {
                "_tlsOptions": {
                  "pipe": false,
                  "secureContext": {
                    "context": {},
                    "singleUse": true
                  },
                  "isServer": false,
                  "requestCert": true,
                  "rejectUnauthorized": true
                },
                "_secureEstablished": true,
                "_securePending": false,
                "_newSessionPending": false,
                "_controlReleased": true,
                "secureConnecting": false,
                "_SNICallback": null,
                "servername": "api.orbitbhyve.com",
                "alpnProtocol": false,
                "authorized": true,
                "authorizationError": null,
                "encrypted": true,
                "_events": {
                  "close": [
                    null,
                    null
                  ],
                  "end": [
                    null,
                    null
                  ],
                  "newListener": [
                    null,
                    null
                  ]
                },
                "_eventsCount": 6,
                "connecting": false,
                "_hadError": false,
                "_parent": null,
                "_host": "api.orbitbhyve.com",
                "_readableState": {
                  "objectMode": false,
                  "highWaterMark": 16384,
                  "buffer": {
                    "head": null,
                    "tail": null,
                    "length": 0
                  },
                  "length": 0,
                  "pipes": null,
                  "pipesCount": 0,
                  "flowing": true,
                  "ended": false,
                  "endEmitted": false,
                  "reading": true,
                  "sync": false,
                  "needReadable": true,
                  "emittedReadable": false,
                  "readableListening": false,
                  "resumeScheduled": false,
                  "emitClose": false,
                  "autoDestroy": false,
                  "destroyed": false,
                  "defaultEncoding": "utf8",
                  "awaitDrainWriters": null,
                  "multiAwaitDrain": false,
                  "readingMore": false,
                  "decoder": null,
                  "encoding": null
                },
                "readable": true,
                "_writableState": {
                  "objectMode": false,
                  "highWaterMark": 16384,
                  "finalCalled": false,
                  "needDrain": false,
                  "ending": false,
                  "ended": false,
                  "finished": false,
                  "destroyed": false,
                  "decodeStrings": false,
                  "defaultEncoding": "utf8",
                  "length": 0,
                  "writing": false,
                  "corked": 0,
                  "sync": false,
                  "bufferProcessing": false,
                  "writecb": null,
                  "writelen": 0,
                  "afterWriteTickInfo": null,
                  "bufferedRequest": null,
                  "lastBufferedRequest": null,
                  "pendingcb": 0,
                  "prefinished": false,
                  "errorEmitted": false,
                  "emitClose": false,
                  "autoDestroy": false,
                  "bufferedRequestCount": 0,
                  "corkedRequestsFree": {
                    "next": {
                      "next": null,
                      "entry": null
                    },
                    "entry": null
                  }
                },
                "writable": true,
                "allowHalfOpen": false,
                "_sockname": null,
                "_pendingData": null,
                "_pendingEncoding": "",
                "_server": null,
                "ssl": {
                  "_parent": {
                    "reading": true,
                    "onconnection": null
                  },
                  "_secureContext": {
                    "context": {},
                    "singleUse": true
                  },
                  "reading": true
                },
                "_requestCert": true,
                "_rejectUnauthorized": true,
                "parser": null,
                "_httpMessage": null,
                "timeout": 0
              },
              "_firstFragment": true,
              "_compress": false,
              "_bufferedBytes": 0,
              "_deflating": false,
              "_queue": []
            },
            "_socket": {
              "_tlsOptions": {
                "pipe": false,
                "secureContext": {
                  "context": {},
                  "singleUse": true
                },
                "isServer": false,
                "requestCert": true,
                "rejectUnauthorized": true
              },
              "_secureEstablished": true,
              "_securePending": false,
              "_newSessionPending": false,
              "_controlReleased": true,
              "secureConnecting": false,
              "_SNICallback": null,
              "servername": "api.orbitbhyve.com",
              "alpnProtocol": false,
              "authorized": true,
              "authorizationError": null,
              "encrypted": true,
              "_events": {
                "close": [
                  null,
                  null
                ],
                "end": [
                  null,
                  null
                ],
                "newListener": [
                  null,
                  null
                ]
              },
              "_eventsCount": 6,
              "connecting": false,
              "_hadError": false,
              "_parent": null,
              "_host": "api.orbitbhyve.com",
              "_readableState": {
                "objectMode": false,
                "highWaterMark": 16384,
                "buffer": {
                  "head": null,
                  "tail": null,
                  "length": 0
                },
                "length": 0,
                "pipes": null,
                "pipesCount": 0,
                "flowing": true,
                "ended": false,
                "endEmitted": false,
                "reading": true,
                "sync": false,
                "needReadable": true,
                "emittedReadable": false,
                "readableListening": false,
                "resumeScheduled": false,
                "emitClose": false,
                "autoDestroy": false,
                "destroyed": false,
                "defaultEncoding": "utf8",
                "awaitDrainWriters": null,
                "multiAwaitDrain": false,
                "readingMore": false,
                "decoder": null,
                "encoding": null
              },
              "readable": true,
              "_writableState": {
                "objectMode": false,
                "highWaterMark": 16384,
                "finalCalled": false,
                "needDrain": false,
                "ending": false,
                "ended": false,
                "finished": false,
                "destroyed": false,
                "decodeStrings": false,
                "defaultEncoding": "utf8",
                "length": 0,
                "writing": false,
                "corked": 0,
                "sync": false,
                "bufferProcessing": false,
                "writecb": null,
                "writelen": 0,
                "afterWriteTickInfo": null,
                "bufferedRequest": null,
                "lastBufferedRequest": null,
                "pendingcb": 0,
                "prefinished": false,
                "errorEmitted": false,
                "emitClose": false,
                "autoDestroy": false,
                "bufferedRequestCount": 0,
                "corkedRequestsFree": {
                  "next": {
                    "next": null,
                    "entry": null
                  },
                  "entry": null
                }
              },
              "writable": true,
              "allowHalfOpen": false,
              "_sockname": null,
              "_pendingData": null,
              "_pendingEncoding": "",
              "_server": null,
              "ssl": {
                "_parent": {
                  "reading": true,
                  "onconnection": null
                },
                "_secureContext": {
                  "context": {},
                  "singleUse": true
                },
                "reading": true
              },
              "_requestCert": true,
              "_rejectUnauthorized": true,
              "parser": null,
              "_httpMessage": null,
              "timeout": 0
            },
            "_bufferedAmount": 0,
            "_isServer": false,
            "_redirects": 0,
            "_url": "wss://api.orbitbhyve.com/v1/events",
            "_req": null
          },
          "_connectTimeout": {
            "_idleTimeout": -1,
            "_idlePrev": null,
            "_idleNext": null,
            "_idleStart": 47809,
            "_onTimeout": null,
            "_repeat": null,
            "_destroyed": true
          },
          "_uptimeTimeout": {
            "_idleTimeout": 5000,
            "_idlePrev": null,
            "_idleNext": null,
            "_idleStart": 49239,
            "_repeat": null,
            "_destroyed": true
          }
        }
      },
      "timeEnding": [
        null,
        0
      ]
MortJC commented 3 years ago

Hi.

Are you running the latest version of the plugin?

On Tue, Aug 17, 2021 at 2:27 AM dxdc @.***> wrote:

Traced the below error to this plugin.

1|homebrid | [8/15/2021, 10:42:47 PM] Your accessories will not persist between restarts until this issue is resolved. 1|homebrid | [8/15/2021, 10:42:47 PM] Failed to save cached accessories to disk: Converting circular structure to JSON 1|homebrid | --> starting at object with constructor 'Timeout' 1|homebrid | | property '_idlePrev' -> object with constructor 'TimersList' 1|homebrid | --- property '_idleNext' closes the circle

Didn't investigate where in the code this trips, but, see the below snippet in cachedAccessories file. Maybe relevant, but I normally leave my timer w/o batteries installed and the wifi unit is connected.

"context": {
  "device": {
    "token": "xx,
    "id": "xx",
    "name": "bhyve_xx",
    "hardware_version": "HT25-0000",
    "firmware_version": "0041",
    "is_connected": true,
    "zones": [
      {
        "station": 1,
        "name": ""
      }
    ],
    "messageQueue": [],
    "rws": {
      "_listeners": {
        "error": [],
        "message": [],
        "open": [],
        "close": []
      },
      "_retryCount": 0,
      "_shouldReconnect": true,
      "_connectLock": false,
      "_binaryType": "blob",
      "_closeCalled": false,
      "_messageQueue": [],
      "_url": "wss://api.orbitbhyve.com/v1/events",
      "_protocols": [],
      "_options": {
        "connectionTimeout": 10000,
        "maxReconnectionDelay": 64000,
        "minReconnectionDelay": 2000,
        "reconnectionDelayGrowFactor": 2
      },
      "_ws": {
        "_events": {},
        "_eventsCount": 4,
        "_binaryType": "nodebuffer",
        "_closeCode": 1006,
        "_closeFrameReceived": false,
        "_closeFrameSent": false,
        "_closeMessage": "",
        "_closeTimer": null,
        "_extensions": {},
        "_protocol": "",
        "_readyState": 1,
        "_receiver": {
          "_writableState": {
            "objectMode": false,
            "highWaterMark": 16384,
            "finalCalled": false,
            "needDrain": false,
            "ending": false,
            "ended": false,
            "finished": false,
            "destroyed": false,
            "decodeStrings": true,
            "defaultEncoding": "utf8",
            "length": 0,
            "writing": false,
            "corked": 0,
            "sync": true,
            "bufferProcessing": false,
            "writecb": null,
            "writelen": 0,
            "afterWriteTickInfo": null,
            "bufferedRequest": null,
            "lastBufferedRequest": null,
            "pendingcb": 0,
            "prefinished": false,
            "errorEmitted": false,
            "emitClose": true,
            "autoDestroy": false,
            "bufferedRequestCount": 0,
            "corkedRequestsFree": {
              "next": null,
              "entry": null
            }
          },
          "writable": true,
          "_events": {},
          "_eventsCount": 6,
          "_binaryType": "nodebuffer",
          "_extensions": {},
          "_isServer": false,
          "_maxPayload": 104857600,
          "_bufferedBytes": 0,
          "_buffers": [],
          "_compressed": false,
          "_payloadLength": 0,
          "_fragmented": 0,
          "_masked": false,
          "_fin": false,
          "_opcode": 0,
          "_totalPayloadLength": 0,
          "_messageLength": 0,
          "_fragments": [],
          "_state": 0,
          "_loop": false
        },
        "_sender": {
          "_extensions": {},
          "_socket": {
            "_tlsOptions": {
              "pipe": false,
              "secureContext": {
                "context": {},
                "singleUse": true
              },
              "isServer": false,
              "requestCert": true,
              "rejectUnauthorized": true
            },
            "_secureEstablished": true,
            "_securePending": false,
            "_newSessionPending": false,
            "_controlReleased": true,
            "secureConnecting": false,
            "_SNICallback": null,
            "servername": "api.orbitbhyve.com",
            "alpnProtocol": false,
            "authorized": true,
            "authorizationError": null,
            "encrypted": true,
            "_events": {
              "close": [
                null,
                null
              ],
              "end": [
                null,
                null
              ],
              "newListener": [
                null,
                null
              ]
            },
            "_eventsCount": 6,
            "connecting": false,
            "_hadError": false,
            "_parent": null,
            "_host": "api.orbitbhyve.com",
            "_readableState": {
              "objectMode": false,
              "highWaterMark": 16384,
              "buffer": {
                "head": null,
                "tail": null,
                "length": 0
              },
              "length": 0,
              "pipes": null,
              "pipesCount": 0,
              "flowing": true,
              "ended": false,
              "endEmitted": false,
              "reading": true,
              "sync": false,
              "needReadable": true,
              "emittedReadable": false,
              "readableListening": false,
              "resumeScheduled": false,
              "emitClose": false,
              "autoDestroy": false,
              "destroyed": false,
              "defaultEncoding": "utf8",
              "awaitDrainWriters": null,
              "multiAwaitDrain": false,
              "readingMore": false,
              "decoder": null,
              "encoding": null
            },
            "readable": true,
            "_writableState": {
              "objectMode": false,
              "highWaterMark": 16384,
              "finalCalled": false,
              "needDrain": false,
              "ending": false,
              "ended": false,
              "finished": false,
              "destroyed": false,
              "decodeStrings": false,
              "defaultEncoding": "utf8",
              "length": 0,
              "writing": false,
              "corked": 0,
              "sync": false,
              "bufferProcessing": false,
              "writecb": null,
              "writelen": 0,
              "afterWriteTickInfo": null,
              "bufferedRequest": null,
              "lastBufferedRequest": null,
              "pendingcb": 0,
              "prefinished": false,
              "errorEmitted": false,
              "emitClose": false,
              "autoDestroy": false,
              "bufferedRequestCount": 0,
              "corkedRequestsFree": {
                "next": {
                  "next": null,
                  "entry": null
                },
                "entry": null
              }
            },
            "writable": true,
            "allowHalfOpen": false,
            "_sockname": null,
            "_pendingData": null,
            "_pendingEncoding": "",
            "_server": null,
            "ssl": {
              "_parent": {
                "reading": true,
                "onconnection": null
              },
              "_secureContext": {
                "context": {},
                "singleUse": true
              },
              "reading": true
            },
            "_requestCert": true,
            "_rejectUnauthorized": true,
            "parser": null,
            "_httpMessage": null,
            "timeout": 0
          },
          "_firstFragment": true,
          "_compress": false,
          "_bufferedBytes": 0,
          "_deflating": false,
          "_queue": []
        },
        "_socket": {
          "_tlsOptions": {
            "pipe": false,
            "secureContext": {
              "context": {},
              "singleUse": true
            },
            "isServer": false,
            "requestCert": true,
            "rejectUnauthorized": true
          },
          "_secureEstablished": true,
          "_securePending": false,
          "_newSessionPending": false,
          "_controlReleased": true,
          "secureConnecting": false,
          "_SNICallback": null,
          "servername": "api.orbitbhyve.com",
          "alpnProtocol": false,
          "authorized": true,
          "authorizationError": null,
          "encrypted": true,
          "_events": {
            "close": [
              null,
              null
            ],
            "end": [
              null,
              null
            ],
            "newListener": [
              null,
              null
            ]
          },
          "_eventsCount": 6,
          "connecting": false,
          "_hadError": false,
          "_parent": null,
          "_host": "api.orbitbhyve.com",
          "_readableState": {
            "objectMode": false,
            "highWaterMark": 16384,
            "buffer": {
              "head": null,
              "tail": null,
              "length": 0
            },
            "length": 0,
            "pipes": null,
            "pipesCount": 0,
            "flowing": true,
            "ended": false,
            "endEmitted": false,
            "reading": true,
            "sync": false,
            "needReadable": true,
            "emittedReadable": false,
            "readableListening": false,
            "resumeScheduled": false,
            "emitClose": false,
            "autoDestroy": false,
            "destroyed": false,
            "defaultEncoding": "utf8",
            "awaitDrainWriters": null,
            "multiAwaitDrain": false,
            "readingMore": false,
            "decoder": null,
            "encoding": null
          },
          "readable": true,
          "_writableState": {
            "objectMode": false,
            "highWaterMark": 16384,
            "finalCalled": false,
            "needDrain": false,
            "ending": false,
            "ended": false,
            "finished": false,
            "destroyed": false,
            "decodeStrings": false,
            "defaultEncoding": "utf8",
            "length": 0,
            "writing": false,
            "corked": 0,
            "sync": false,
            "bufferProcessing": false,
            "writecb": null,
            "writelen": 0,
            "afterWriteTickInfo": null,
            "bufferedRequest": null,
            "lastBufferedRequest": null,
            "pendingcb": 0,
            "prefinished": false,
            "errorEmitted": false,
            "emitClose": false,
            "autoDestroy": false,
            "bufferedRequestCount": 0,
            "corkedRequestsFree": {
              "next": {
                "next": null,
                "entry": null
              },
              "entry": null
            }
          },
          "writable": true,
          "allowHalfOpen": false,
          "_sockname": null,
          "_pendingData": null,
          "_pendingEncoding": "",
          "_server": null,
          "ssl": {
            "_parent": {
              "reading": true,
              "onconnection": null
            },
            "_secureContext": {
              "context": {},
              "singleUse": true
            },
            "reading": true
          },
          "_requestCert": true,
          "_rejectUnauthorized": true,
          "parser": null,
          "_httpMessage": null,
          "timeout": 0
        },
        "_bufferedAmount": 0,
        "_isServer": false,
        "_redirects": 0,
        "_url": "wss://api.orbitbhyve.com/v1/events",
        "_req": null
      },
      "_connectTimeout": {
        "_idleTimeout": -1,
        "_idlePrev": null,
        "_idleNext": null,
        "_idleStart": 47809,
        "_onTimeout": null,
        "_repeat": null,
        "_destroyed": true
      },
      "_uptimeTimeout": {
        "_idleTimeout": 5000,
        "_idlePrev": null,
        "_idleNext": null,
        "_idleStart": 49239,
        "_repeat": null,
        "_destroyed": true
      }
    }
  },
  "timeEnding": [
    null,
    0
  ]
  ```

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/MortJC/homebridge-platform-orbit/issues/37, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN5E4TVMQDI4FURSTTATCCLT5E36RANCNFSM5CICF2NA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

dxdc commented 3 years ago

Hi @MortJC -- yes

MortJC commented 3 years ago

The JSON you provided looks to be from an old version. Can you delete the accessory from the cache?

On Tue, Aug 17, 2021 at 7:31 AM dxdc @.***> wrote:

Hi @MortJC https://github.com/MortJC -- yes

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MortJC/homebridge-platform-orbit/issues/37#issuecomment-899831861, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN5E4TRDIDKJDKWVRT4WCMTT5F7TXANCNFSM5CICF2NA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

dxdc commented 3 years ago

@MortJC I should have mentioned, I tried that.

  1. Remove the accessory from config.
  2. Restart homebridge. Accessory was removed from cachedAccessories. (Note, this error disappeared with it)
  3. Add the accessory back to config, restart homebridge.

Accessory is added back, and the same JSON appears in cachedAccessories (as above). As mentioned though, not sure if the issue is that my accessory hasn't connected in a while.

I'm running v1.5.1 and HB 1.3.5.

MortJC commented 3 years ago

Can you try removing the plugin and re-adding it?

On Tue, Aug 17, 2021 at 2:05 PM dxdc @.***> wrote:

@MortJC https://github.com/MortJC I should have mentioned, I tried that.

  1. Remove the accessory from config.
  2. Restart homebridge. Accessory was removed from cachedAccessories. (Note, this error disappeared with it)
  3. Add the accessory back to config, restart homebridge.

Accessory is added back, and the same JSON appears in cachedAccessories (as above). As mentioned though, not sure if the issue is that my accessory hasn't connected in a while.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MortJC/homebridge-platform-orbit/issues/37#issuecomment-899976761, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN5E4TTB745RGMFMQ2LHENLT5HNYPANCNFSM5CICF2NA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

dxdc commented 3 years ago

Thx for the suggestion. I tried that also. I also tried upgrading Node to 14. Didn't change the result unfortunately.

MortJC commented 3 years ago

Hi,

I've removed the caching of the device object which I think was causing the problem. Please update.

On Wed, Aug 18, 2021 at 7:02 AM dxdc @.***> wrote:

Thx for the suggestion. I tried that also. I also tried upgrading Node to

  1. Didn't change the result unfortunately.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MortJC/homebridge-platform-orbit/issues/37#issuecomment-900627858, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN5E4TSK32AG2DRUENGIISLT5LE6RANCNFSM5CICF2NA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .

dxdc commented 3 years ago

Thanks @MortJC!

I got it working, but had to purge the accessory from cachedAccessories to work. There was no effect to that file just restarting HB.

Now, the context object looks like this:

    "context": {
      "timeEnding": [
        null,
        0
      ]
    },

Definitely looks a lot better, as long as this is the expected result? Also, may be worth including some command to specifically overwrite the context object on new version restart so users don't have to manually purge the accessory from cachedAccessories like I did.