Skip to content

Setting ParseObject id loses all pending operations #146

@grantland

Description

@grantland
object = new Parse.Object('TestObject');
object.set('foo', 'bar');
object.set('id', '1234');
object.save(); // expected: { id: '1234' , 'foo': 'bar'}, actual: { id: '1234' }

or

object = new Parse.Object('TestObject');
object.set('foo', 'bar');
object.id = '1234';
object.save(); // expected: { id: '1234' , 'foo': 'bar'}, actual: { id: '1234' }

It looks like this is due to the fact that we map objectId to pending ops, so changing the objectId will map to a different or null pending ops.

My current workaround is to call object._migrateId('1234') instead.

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions