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

Acknowledgement callback without namespace #7

Closed
ken-chen-icsgame opened this issue Aug 17, 2020 · 2 comments
Closed

Acknowledgement callback without namespace #7

ken-chen-icsgame opened this issue Aug 17, 2020 · 2 comments

Comments

@ken-chen-icsgame
Copy link

Server side with Kotlin:

	namespace = socketIoServer.namespace("/chat")
	namespace.on("connection") { clients ->
		val client = clients.firstOrNull() as? SocketIoSocket
		client?.on("custom-event") {
			val callback = it.firstOrNull() as? SocketIoSocket.ReceivedByLocalAcknowledgementCallback
			callback?.sendAcknowledgement("hello callback")
		}
	}

Client side with TypeScript:

	const socket = io("http://myspace:8080/chat", {
		transports: ["websocket"],
	})
	socket.on("connect", () => {
		socket.emit("custom-event", function(data?: any) {
			console.log(data) 
		})
	})

Client side emit message:

42/chat,0["custom-event"]

PROBLEM:

The Acknowledgement callback event sent by server without namespace:

430["hello callback"]

@trinopoty
Copy link
Owner

Looks like I messed up translating the JS code a bit. And since I don't use ack, I've never run across this bug.
I'll push out a fix some time tomorrow.

@trinopoty
Copy link
Owner

The new version 1.0.2 should be available on maven in a few hours.

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

2 participants