Question: when trying the Chat sample application ...
# ktor
l
Question: when trying the Chat sample application using two browsers in the same computer, I get messages sent only to one of such browsers
Is this expected?
d
I have tried, and seems to work fine. If you open several tabs in the same browser, it will use the same session and that username will be the same. I have tried several different sessions in chrome, firefox, safari and works as expected in all them. If I write one message in one browser I see the message in all the opened browsers/tabs including the one who wrote the message. What’s you setup? Can you record a video? Or check your browser’s developer’s console and check the WS frames to see if everything looks fine?
l
What I did was to copy the source files to an empty Maven project, and renamed the packages
Windows 10, IDEA community, etc.
here's a screenshot
¯\_(ツ)_/¯
I don't know how to attach a file in this thread

https://kotlinlang.slack.com/files/U8PG0PB2A/FAUSSU2QJ/screenshot.png

In the screenshot, what I did: I first opened Chrome, typed "first message window 1" - then opened Firefox and typed "second message window 2" (this message didn't appear in the first window)
Then typed "/help" in the first window (worked OK) and the same in the second window (also OK).
d
have you tried to run it vanilla?
using gradle?
./gradlew :chat:run
just in case something was messed up in the process
and btw the screenshot doesn’t work
l
I'm trying to run it with gradle now
👍 1
in case somebody sees this, the problem is that I was using the samples in the main distribution, which aren't up to date - use the ktor-samples repository: https://github.com/ktorio/ktor-samples
👌 1
d
Edit. Further details: Ok, so after some research in private messages: There was a bug in the chat application that was fixed in the ktor-samples repo here, https://github.com/ktorio/ktor-samples/commit/3521a10e55bf1e12299971a1c3cd318c290e207c#diff-041b83b89b5578624746dd57b382b46b But it seems that there are still samples in the ktor repo that are outdated, and the chat app contained that bug. There is an opened PR to remove samples from the ktor repository: https://github.com/ktorio/ktor/pull/340