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

custom data (chatroom, message) are not updated via websocket #2

Open
Rezi opened this issue Dec 29, 2016 · 0 comments
Open

custom data (chatroom, message) are not updated via websocket #2

Rezi opened this issue Dec 29, 2016 · 0 comments

Comments

@Rezi
Copy link

Rezi commented Dec 29, 2016

Looks like I was able to make the whole setup via docket toolbox for mac.

I created my own config.js file and set up facebook app. After logging in in two browsers, I can see each other in the chat.Once I click the other person the chat window is opened and I see the "create" request in devtools network tab.
However the newly created data added to the ChatController.ChatroomChannel.objects['new'] are never send back via websockets. In dev tools the websocket only receive 2probe, 3probe, device bind data and ready flag. The I see only numbers 2 and 3 received occasionally.

I wonder whether it is due to wrong schema setup or something different. I dont see any errors except the ones which in browser console telling me "Cannot read property 'objects' of undefined" here on chat_ctrl.js

on('focus', function() { //when putting the input in focus we send the seen flag unless the last message already has it var message = ChatController.MessagesChannel.objects[ChatController.lastHisMessageId]; if (message && !message.seen) ChatController.MessagesChannel.objects[ChatController.lastHisMessageId].seen = true; });

but it is because I never got the websocket custom data back.

I guess the issue can be with my schema.json which I needed to modify to work at all.. (the one shown in tutorial is not wrapped to "schema" and does not have appId). Here is my schema:

{ "appId": "9bc4221c-168e-4f11-b997-499d700dca16", "schema": { "chatroom":{ "meta_read_acl":6, "properties":{ "participant_1":{ "type":"user" }, "participant_2":{ "type":"user" }, "recipient_is_typing":{ "type":"bool" }, "sender_is_typing":{ "type":"bool" } }, "read_acl":6, "write_acl":6 }, "message":{ "belongsTo":[{ "parentModel":"chatroom" }], "meta_read_acl":6, "properties":{ "received":{ "type":"bool" }, "recipient_id":{ "type":"user" }, "seen":{ "type":"bool" }, "text":{ "type":"string"} }, "read_acl":6, "write_acl":6 }, "task":{ "meta_read_acl":6, "properties":{ "completed":{ "type":"bool" }, "recipient_id":{ "type":"user" }, "text":{ "type":"string" } }, "read_acl":6, "write_acl":6 } } }
screen shot 2016-12-29 at 12 28 45

Any help highly appreciated.

Thanks for awesome work

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