-
Notifications
You must be signed in to change notification settings - Fork 2k
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
publishCreate() generates error after upgrading to v.0.12 #3558
Comments
It works if I remove but I do not know what side-effects this causes or why toJSON() is being used vs JSON.stringify |
Thanks @metalaureate, we'll check it out and post here if we need more info. |
I think the problem is that I am not passing bona fide sailsjs model to the publishCreate. It works with this kludge:
Is there a more elegant way to construct my payload that inherits the toJSON() method from sails? |
No, and you shouldn't need to. The I'll look into a fix and some tests to ensure that it doesn't happen again. |
You guys are awesome thank you. |
Reverts https://github.com/balderdashy/sails/pull/3228/files#diff-002a80574a8e0850be1da26af49bd343L43 and restores ability to use publishCreate without a model instance. refs #3558
0.12.1 has been released with this fix! |
After upgrading https://github.com/maangalabs/socket-in-sails to v.0.12, when I call
Chat.publishCreate({id: data_from_client.id, message : data_from_client.message , user:data_from_client.user},req);
I get error
This also happens if I port the code to a fresh v.0.12 sails project.
The text was updated successfully, but these errors were encountered: