Skip to content

Saving model with auto-fetched relations causes stack overflow #279

@dirkmc

Description

@dirkmc

If a model has autoFetch true, and you fetch the model then try to save it, Node reports:

RangeError: Maximum call stack size exceeded
2 Aug 19:22:00 - [nodemon] app crashed - waiting for file changes before starting...

If the auto-fetched field is overwritten it saves ok:

db.Post.get(1337, function(e,p) {
    p.user = null;
    p.channel = null;
    p.template = null;
    p.save({ updated_at: new Date() }, function(err) {
        console.log('done')
    });
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions