Repository navigation
Conversation
AndrewJDR
force-pushed
the
fix_for_params_clobbering_in_update_v2
branch
from
December 20, 2018 10:34
fda09fa to
7f44f75
Compare
AndrewJDR
force-pushed
the
fix_for_params_clobbering_in_update_v2
branch
from
December 20, 2018 11:16
7f44f75 to
cabf55a
Compare
Member
|
Thank you! Will go out with the next release |
AndrewJDR
added a commit
to AndrewJDR/feathers-sequelize
that referenced
this pull request
Dec 21, 2018
This is a test to further address issue feathersjs-ecosystem#234. While PR feathersjs-ecosystem#252 did fix some of the issues, some attributes are still not being passed through to some of the service calls as these tests failures will indicate. Proposed fixes for these new test failures will be forthcoming.
AndrewJDR
added a commit
to AndrewJDR/feathers-sequelize
that referenced
this pull request
Dec 21, 2018
This is a test to further address issue feathersjs-ecosystem#234. While PR feathersjs-ecosystem#252 did fix some of the issues, some attributes are still not being passed through to some of the service calls as these tests failures will indicate. Proposed fixes for these new test failures will be forthcoming.
AndrewJDR
added a commit
to AndrewJDR/feathers-sequelize
that referenced
this pull request
Dec 22, 2018
This is a test to further address issue feathersjs-ecosystem#234. While PR feathersjs-ecosystem#252 did fix some of the issues, some attributes are still not being passed through to some of the service calls as these tests failures will indicate. Proposed fixes for these new test failures will be forthcoming.
daffl
pushed a commit
that referenced
this pull request
Dec 26, 2018
* Added tests for custom attributes for custom getModel(). This is a test to further address issue #234. While PR #252 did fix some of the issues, some attributes are still not being passed through to some of the service calls as these tests failures will indicate. Proposed fixes for these new test failures will be forthcoming. * Fix some getModel() / parameter passing related test failures. This is a continuation of the work to fix issue #234. Some service calls were still failing to pass through params.sequelize, which again could cause issues for users that are extending the Service class with their own getModel() method that depends upon certain parameters being passed through to it. * Fix remaining failing tests and introduce more getModel checks. The getModel parameter passing tests now also check that the custom getModel method has been called by the service methods. This will help protect against potential future regressions that somehow fail to call getModel(). * Run lint, make some variable names friendlier.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is another attempt at a resolution for issue #234. I will paste the content of the issue report below:
Take a look at these two lines:
https://github.com/feathersjs-ecosystem/feathers-sequelize/blob/master/lib/index.js#L245
https://github.com/feathersjs-ecosystem/feathers-sequelize/blob/master/lib/index.js#L259
Lines like these do overrides such as
raw: false, which is totally fine, but in the process they also fail to pass through the other attributes of theparamsobject that was provided by the original caller of the service method (further up the callstack).When a service call is made by some featherjs user's code, it's important to preserve the
paramsobject when making any subsequent service calls, as it's possible that the user of feathersjs intends to use these parameters as part of agetModel()override function in a custom service class (i.e.class MySpecialService extends Servicewith an overiddengetModel()) For things like multi-tenancy schemes (hosting multiple domains/sites out of a single app instance such that each site needs to hit a different database).Any practice of ignoring/clobbering the params passed in will cause problems for such a scheme.
For the most part I have not noticed an issue with this -- As far as I know, get, find, and most other service calls do not have this practice of completely overriding the params with their own value, but update does have this issue. I will submit a pull request for this.