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

Socket call doesn't execute same controller action override HTTP call does. #535

Closed
toddrimes opened this issue Jul 8, 2013 · 5 comments
Milestone

Comments

@toddrimes
Copy link

/---------------------
:: Messages
-> controller
---------------------
/
var MessagesController = {
index: function (req,res) {
var user = req.session.user;
var group_id = user.group_id;
Messages.findAllByGroup_id(group_id).limit(50).sort('createdAt DESC').done(function (err, messages) {
if (err) return res.send(err,500);
else res.send({ messages: messages });
});
}
};
module.exports = MessagesController;

I have that override of the MessagesController index action, with routes.js updated with it. The app is group chat where X users could each be "chatting" in exactly one of Y groups. Each user should only post/receive messages to/from their group and never have access to those of other groups(otherwise I could filter on the client).

Override method /messages/index works fine from the browser and I can set and hit a breakpoint in my IDE to verify it's executing. However, I do not hit the breakpoint when I use a socket pointing at /messages. Shouldn't they behave the same? What am I doing wrong?

@mikermcneil
Copy link
Member

hi @toddrimes- what version of sails are you running?

@toddrimes
Copy link
Author

Hi, Mike:

sails@0.8.94

Thank you,
~Todd

On Mon, Jul 8, 2013 at 6:05 AM, Mike McNeil notifications@github.comwrote:

hi @toddrimes- what version of sails are you running?


Reply to this email directly or view it on GitHubhttps://github.com//issues/535#issuecomment-20603606
.

@mikermcneil
Copy link
Member

Hey Todd, they should. This should be resolved in 0.9- after we get that out the door, I'll swing back by for a hot fix. Thanks!

@toddrimes
Copy link
Author

cool, thank you!

Is that days or weeks away?

On Mon, Jul 8, 2013 at 9:38 PM, Mike McNeil notifications@github.comwrote:

Hey Todd, they should. This should be resolved in 0.9- after we get that
out the door, I'll swing back by for a hot fix. Thanks!


Reply to this email directly or view it on GitHubhttps://github.com//issues/535#issuecomment-20653046
.

@mikermcneil
Copy link
Member

@toddrimes sorry I missed your note here-- 0.9 came out over the summer. Thanks for your help!

If you're still encountering this issue in v0.10, would you reopen this issue or create a new one and mention me? (@mikermcneil) Thanks!

Upgrading to Sails v0.10 beta:

Install:
$ sudo npm install -g sails@beta -g

Docs:
beta.sailsjs.org

Migration Guide for v0.9.x apps:
https://github.com/balderdashy/sails-docs/blob/master/Migration-Guide.md

Contribution Guide | Stackoverflow | Google Group | Trello | IRC

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

No branches or pull requests

2 participants