Skip to content

#<Object> could not be cloned. #27

@AggressivelyMeows

Description

@AggressivelyMeows

Trying to get a service setup using this lib however im running into some strange issues with persistance.

For some reason, when doing a filter over an array, it breaks with the error "# could not be cloned.". While debugging, it appears that forcing JS to create a new Array using JSON.parse/stringify, it successfully saves. Although i'm not convinced this hotfix will work 100% of the time.

console.log(
  this.repeat_queue, // [   { event: 'testEvent.created', object: {  }, repeat_count: 0 } ]
  this.repeat_queue.isProxy // true
)

this.repeat_queue = this.repeat_queue.filter(e => e.id != event.id)

console.log(
  this.repeat_queue, // [   { event: 'testEvent.created', object: {  }, repeat_count: 0 } ] - Yes, the array is the same. However its considered dirty due to the Filter (??)
  this.repeat_queue.isProxy // true
)

If you wanted to see the code for yourself:
https://github.com/drivly/webhooks.do/blob/main/src/webhook.durable.js#L119

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions