network tab in chrome doesnt update for every request sent - ajax

so for instance, this is difficult to explain but i will try to my best ability.
if you refresh a page on for instance a discord channel, an ajax request is sent to:
https://discord.com/api/v8/channels/channelidhere/messages?limit=50
which gets the last 50 messages sent in the channel. now, interestingly enough, if youre in a channel with lots of new messages being sent the netwrok tab does not update as if there were no requests associated with the channel messages being updated. ive seen this happen with other sites in similar ways and im just curious as to what i may be missing, is there some reason a request would be sent that the network tab doesnt catch? ps: even if i go to the all tab which supposedly captures all requests still no bueno.

It's common that chat website use websockets instead of http to communicate.
maybe this will help you How do you inspect websocket traffic with Chrome Developer Tools?

Related

Salesforce Live Chat api concurrent requests

I've tried to extend my chatbot with salesforce live agent api. So I've implemented all the process, and chat works correct, except one thing - It won't work on multiple tabs. When one tab have long polling connection (left side on the screenshot), and I open new tab (right side) - old tab (left) receive:
409 Conflict
Duplicate Message Observer
Is it possible, and can I use multiple tabs with salesforce long polling connection on my online shop? (it is general situation, when customer has many tabs, and each of them should be with the same chat)
I use salesforce Messages api endpoint: https://developer.salesforce.com/docs/atlas.en-us.live_agent_rest.meta/live_agent_rest/live_agent_rest_Messages.htm
You can't work with multiple tabs on the Salesforce. You can make the backend part, where you can make a locker. (only one request pass to the SF, but all other waits for the master-request

How to send a message when the user is leaving the page using SignalR?

I'm working on a chat room program using ASP.NET, I have made a 'user has joined the chatroom' message, but how would I send a message when the user leaves the page? I tried looking through the network logs, but I can't see any extra messages getting sent through the WebSocket.
This will be tough and inaccurate because there is really no guarantee that you will get notified that the user has disconnected. But there is an onDisconnect event that you can listen for, but in all honesty, I would use a disconnect button and use that to do what you need to do, it would be more consistent, as the disconnect is not reliable (at least the last time I used SignalR, which was like version 1.x)
Nevermind, I've found out about window.onbeforeunload using JavaScript. Though it's not 100% consistent, it's more consistent than I expected.

Is it posible to send multiple message to Google Home through DialogFlow?

On facebook Chatbot or others platform we can send message directly to the user.
So for one question we can send multiple answer.
Now, that i'm developing for Google Home, I need to do the same.
I didn't find this opttion.
Dialogflow HTTP call to my server is the only output available.
So is there anything i missed to send message back to user in case I have a multiple messages answer?
(Or do I have to bufferise very message my hook creates before sending it back?)
Thanks
The conversation model for the Google Assistant is different - you can only send a message to the user in response to the user sending you a message. You can only send a single response, but it may have multiple parts (up to two Simple responses, containing messages, plus other features such as cards and carousels).
If you need to send multiple things back - you may need to rethink how you're doing it or how much you're sending back at a time. The Assistant is primarily for audible responses, and a long audible response is generally not a good UX.

How to request botstate users on Microsoft Teams via Rest

If I send the Get request /v3/botstate/{channelId}/users/{userId} request to the emulator, it returns JSon. Nothing very useful of course since there aren't any real users in it. (doc referenced for the request https://docs.botframework.com/en-us/restapi/state/#/ and https://docs.botframework.com/en-us/csharp/builder/sdkreference/stateapi.html#getsetproperties)
If I send it to Teams, I get a 500 Server error. No additional information is returned with the error, it just repeats that there was a server error.
When I have gotten a 500 sending to Teams before, it was related to the JSon payload being sent. In this case, there is no payload.
The request is in response to a "message" my bot received, and I am passing along the channelId and from.id from that "message" as my parameters.
I am able to send Post "message" requests back, and the Get request /v3/conversations{conversationId}/members successfully, so my Bot seems to be setup correctly.
Anyone have any ideas?
There was a temporary issue with Teams this week. It has been fixed.
The ServiceUrl is not guaranteed to stay the same. It should be refreshed periodically. Please see: https://docs.botframework.com/en-us/csharp/builder/sdkreference/routing.html#connectorclient
NOTE: Even though ServiceUrl values may seem stable bots should not
rely on that and instead always use the ServiceUrl value
As of today, the Bot Framework is still in preview. The developers do their best to not commit breaking changes. The product is under continuous and active development. Thank you for your patience as the kinks are worked out.
Microsoft Teams does not currently support retrieving user information beyond the ID returned in the members call, or the information received as part of incoming payloads. We should have better support for this coming soon.

Real-time chat issue (django/js)

I'm working on a real-time chat. I need to change statuses of the room owner and connected users, together with the UI. Since NodeJS/SocketJS/etc don't guarantee message delivery, I switched to pure Ajax for that.
The system works like that:
- User presses a button to change his status
- An Ajax request is being sent to the server, and a status change request is being saved in the queue in DB
- Users send Ajax heartbeats every second. On the server this heartbeat function also processes the queue (when sent by the room owner). Besides it sends the current statuses of users in the room in response every time.
The issue is: there might be temporary internet problems on both sides, which causes all kinds of problems. This happens due to the fact, that the heartbeat Ajax requests are being processed in an arbitrary order on the server, or the responses are being received in a wrong order on the client side. As a result users have wrong data about current statuses and the UI changes are also wrong.
What is the best approach when making a system like that? What am I doing wrong or how can I fix the issues above?
Thank you!
Have a look at Max's blog a Django-Realtime-Chat and how he does it.

Resources