Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with DELETE #10

Open
ghost opened this issue Sep 3, 2014 · 3 comments
Open

Issue with DELETE #10

ghost opened this issue Sep 3, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Sep 3, 2014

Hi guys

I noticed the latest implementation is getting errors handling DELETE requests after upgrading recently.

Here are the relevant versions from package.json :

OLD WORKING

"backbone": "~1.1.2", "backbone-rest": "~0.5.7", "backbone-orm": "~0.5.15",

NEW BROKEN

"backbone": "^1.1.2", "backbone-orm": "^0.7.0", "backbone-rest": "^0.7.2",

Here is the error that Im seeing ...

Error 500 from DELETE /api/tag/51: TypeError: Object #<Schema> has no method 'idType' at Function.module.exports.JSONUtils.parseField (/app/node_modules/backbone-rest/node_modules/backbone-orm/backbone-orm.js:1007:52) at RESTController.module.exports.RESTController.requestId (/app/node_modules/backbone-rest/lib/rest_controller.js:51:24) at RESTController.module.exports.RESTController.destroy (/app/node_modules/backbone-rest/lib/rest_controller.js:220:42) at /app/node_modules/backbone-rest/lib/lib/json_controller.js:88:23 at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:76:5) at next (/app/node_modules/express/lib/router/route.js:100:13) at RESTController.module.exports.JSONController._setHeaders (/app/node_modules/backbone-rest/lib/lib/json_controller.js:115:14) at /app/node_modules/backbone-rest/lib/lib/json_controller.js:11:61 at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:76:5) at next (/app/node_modules/express/lib/router/route.js:100:13)

Thanks for your work - REST/ORM all in one, brilliant!

@kmalakoff
Copy link
Member

We're glad you are enjoying it. Sorry about this problem...

I've looked at 0.7.0 and it seems to have typeId defined in schema. Can you try upgrading BackboneORM to 0.7.1 and see if the issue still happens?

If so, I might need you put together a test case.

@ghost
Copy link
Author

ghost commented Sep 4, 2014

I can confirm that this is still happening for me when I upgrade to 0.7.1

So Backbone dependencies are :

"backbone": "~1.1.2", "backbone-orm": "~0.7.1", "backbone-rest": "~0.7.2",

Error message is same but - obviously - line numbers are different :

Error 500 from DELETE /api/tag/44: TypeError: Object #<Schema> has no method 'idType' at Function.module.exports.JSONUtils.parseField (D:\dev\src\heroku\tcapp\node_modules\backbone-orm\backbone-orm.js:1002:52) at RESTController.module.exports.RESTController.requestId (D:\dev\src\heroku\tcapp\node_modules\backbone-rest\lib\rest_controller.js:51:24) at RESTController.module.exports.RESTController.destroy (D:\dev\src\heroku\tcapp\node_modules\backbone-rest\lib\rest_controller.js:220:42) at D:\dev\src\heroku\tcapp\node_modules\backbone-rest\lib\lib\json_controller.js:88:23 at Layer.handle [as handle_request] (D:\dev\src\heroku\tcapp\node_modules\express\lib\router\layer.js:76:5) at next (D:\dev\src\heroku\tcapp\node_modules\express\lib\router\route.js:100:13) at RESTController.module.exports.JSONController._setHeaders (D:\dev\src\heroku\tcapp\node_modules\backbone-rest\lib\lib\json_controller.js:115:14) at D:\dev\src\heroku\tcapp\node_modules\backbone-rest\lib\lib\json_controller.js:11:61 at Layer.handle [as handle_request] (D:\dev\src\heroku\tcapp\node_modules\express\lib\router\layer.js:76:5) at next (D:\dev\src\heroku\tcapp\node_modules\express\lib\router\route.js:100:13)

I'll try to prioritise some time to dig a bit deeper, but quite happy with older release so don't feel an urgent need to upgrade .

@kmalakoff
Copy link
Member

Odd. We have tests for destroy and the function looks to exist.

Would you be able to send me your model (or at least a simplified version if it is confidential) and your rest controller parameters so I can try to replicate the problem?

@kmalakoff
Copy link
Member

I've discussed with a colleague and we think it might be a deduping problem or an install problem.

Do you have have multiple copies of BackboneORM installed (for example, in global node_modules or some of your dependencies are still referring to 0.5.x so there are multiple copies in your application's node_models). Also, you could try npm cache clear -g and try a clean install.

Let me know if this is the case, otherwise, my colleague was suggesting you share your application with me on Dropbox, zip it up, etc. Not sure if it is confidential so might not be an options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant