Skip to content

breeze.savequeuing.js QueueSaveFailedError "Converting Circular Structure"" #36

@Eblax

Description

@Eblax

After getting some errors "Queued save failed: Converting circular structure to JSON" when saving in Breeze I tracked the issue down to the function rememberAddedOriginalValues in breeze.savequeuing.js

My theory is that the circular structure issue happens because the list of Added entities sometimes ends up containing Modified (and other?) entities.

On line ~189 after:

var added = entities ? entities.filter(function (e) { return e.entityAspect.entityState.isAdded(); }) : entities.filter(function (e) { return e.entityAspect.entityState.isAdded(); }) : self.entityManager.getChanges(null, breeze.EntityState.Added);

It looks like the array in added should contain only Added entities, however for some reason it sometimes contains other entries.

To remove these other entities I added this immediately after the previous lines to remove entities with entitystates other than Added:

for(var x = 0; x < added.length; x++) { if(added[x].entityAspect && added[x].entityAspect.entityState.name != breeze.EntityState.Added) { added.splice(x, 1); x--; } }

This at least seems to have sorted my issues.

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