Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngResource): restore shallowClearAndCopy properties fitlering condition #5666

Closed
wants to merge 4 commits into from

Conversation

atomrc
Copy link
Contributor

@atomrc atomrc commented Jan 7, 2014

Change the way properties are fitlered to create a resource from a
JavaScript Object.

in angular version >= 1.2.6 properties of a resource with a name
beginning by a single '$' were fitlered from the created resource.
Problem cames from the upgrade of the condition to filter properties that
have a '$$' prefix in the shallow copy. See commit cb29632.

Restore the behavior ngResource had in angular 1.2.5 and inferior
versions.

@IgorMinar
Copy link
Contributor

I'm sorry, but I wasn't able to verify your CLA signature. CLA signature is required for any code contributions to AngularJS.

Please sign our CLA and ensure that the CLA signature email address and the email address in this PR's commits match.

If you signed the CLA as a corporation, please let me know the company's name.

Thanks a bunch!

PS: If you signed the CLA in the past then most likely the email addresses don't match. Please sign the CLA again or update the email address in the commit of this PR.
PS2: If you are a Googler, please sign the CLA as well to simplify the CLA verification process.

@atomrc
Copy link
Contributor Author

atomrc commented Jan 7, 2014

Oups my bad ! Should be ok now.

@ghost ghost assigned tbosch and vojtajina Jan 8, 2014
@vojtajina
Copy link
Contributor

@thomasbelin4 can you make sure you signed the CLA with the email you are using on github ([email protected]) ?

Honestly I don't know why we strip out the $ properties, as the shallowClearAndCopy function is only used when serializing the data FROM server (I thought we were removing the $ properties when sending TO server, to ignore all the APIs such as $save). I think we could just copy all properties. Would that fail any of the existing tests?

@vojtajina
Copy link
Contributor

I just looked into cb29632 and I think we should fix the shallowClearAndCopy in src/Angular.js too. The cb29632 changed meaning of the condition. Your condition is correct and should perform the same.

@atomrc
Copy link
Contributor Author

atomrc commented Jan 8, 2014

Ok I signed the CLA with the right email address (sorry about that, that was my work git config) and also fixed the shallowCopy in src/Angular.js.
Tell me if there is anything else

@lord2800
Copy link

lord2800 commented Jan 8, 2014

Just FYI, there's a typo in the first commit message: fitlering --> filtering

@atomrc
Copy link
Contributor Author

atomrc commented Jan 9, 2014

It seems the travis build failed, but I don't really understand why.
Could you help me out.
There are two errors in the log :

  • first when minifying Angular.js - > build/angular.js:3672: WARNING - Throw expression is not a minErr instance.
  • then when the script ./scripts/travis/wait_for_browser_provider.sh is ran and the error is : No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.

Thank for your help

@atomrc
Copy link
Contributor Author

atomrc commented Jan 14, 2014

@vojtajina ok, I tried a rebase in order to force the build and it passes now. Is there anything else I should do before my PR can be merged ?

Thomas Belin added 4 commits February 4, 2014 15:23
…dition

Change the way properties are fitlered to create a resource from a
JavaScript Object.

in angular version >= 1.2.6 properties of a resource with a name
beginning by a single '$' were fitlered from the created resource.
Problem cames from the upgrade of the condition to filter properties that
have a '$$' prefix in the shallow copy. See commit cb29632.

Restore the behavior ngResource had in angular 1.2.5 and inferior
versions.
in angular version >= 1.2.6 shallowCopy also filtered properties
prefixed with a single `$`
Problem cames from the upgrade of the condition to filter properties
that have a '$$' prefix (See commit cb29632).

Restore the behavior shallowCopy had in angular 1.2.5 and previous
versions.
    in angular version >= 1.2.6 shallowCopy also filtered properties
    prefixed with a single `$`
    Problem cames from the upgrade of the condition to
    filter properties
    that have a '$$' prefix (See commit cb29632).

    add unit tests for the shallowCopy in AngularSpec
…ndition

    Change the way properties are fitlered to create a resource
    from a
    JavaScript Object.

    in angular version >= 1.2.6 properties of a
    resource with a name
    beginning by a single '$' were fitlered from
    the created resource.
    Problem cames from the upgrade of the
    condition to filter properties that
    have a '$$' prefix in the shallow
    copy. See commit cb29632.

    add the unit tests for shallowClearAndCopy function
caitp pushed a commit to caitp/angular.js that referenced this pull request Feb 4, 2014
… requests/responses

ngResource no longer filters properties prefixed with a single "$" character from requests or
responses, correcting a regression introduced in 1.2.6 (cb29632).

Closes angular#5666
Closes angular#6080
Closes angular#6033
caitp pushed a commit to caitp/angular.js that referenced this pull request Feb 4, 2014
… requests/responses

ngResource no longer filters properties prefixed with a single "$" character from requests or
responses, correcting a regression introduced in 1.2.6 (cb29632).

Closes angular#5666
Closes angular#6080
Closes angular#6033
@caitp caitp closed this in d2e4e49 Feb 4, 2014
@atomrc atomrc deleted the ng-resource-shallow-copy branch February 4, 2014 15:59
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants