Skip to content

Potential regression when setting id directly from 1.2.1 to 1.2.2 #3778

@swanson

Description

@swanson

As part of upgrading from 1.2.1 to 1.2.2, we noticed an issue in our app where we were directly setting id on a model. I don't think this is the best way to set the id, but it is what it is.

model.id = SOME_ID

After setting additional properties via set later in our code, model.id started to return undefined.

Below is a minimal example. The expected behavior is that both console.log's will output "123". In 1.2.2 calling set is wiping out model.id (appears to be from this commit: be7fc95)

You can run these fiddles and see the output in the console.

1.2.1: https://jsfiddle.net/jktms1xx/2/

> 123
> 123

1.2.2: https://jsfiddle.net/g1am1otw/1/

> 123
> undefined

We've resolved this issue by changing our code to call model.set('id', SOME_ID) - but we were wondering if setting model.id directly should continue to work. Thanks!

cc @jbrad

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions