Skip to content

Conversation

@rgarcia
Copy link
Contributor

@rgarcia rgarcia commented Aug 4, 2025

#45 plus

  • switching to use our build of the neko image
  • bringing back double cursor (lowers perceived latency)

thanks very much to @raiden-staging !

@rgarcia rgarcia requested a review from Sayan- August 4, 2025 22:55
@mesa-dot-dev
Copy link

mesa-dot-dev bot commented Aug 4, 2025

Mesa Description

TL;DR

Addresses peer disconnections by upgrading to our custom Neko image, re-enabling double cursor for better latency, and enhancing Neko authentication and debugging.

Why we made these changes

To fix ongoing peer disconnection issues, improve user experience by reducing perceived latency, and integrate Neko with our internal authentication and build processes.

What changed?

  • images/chromium-headful/Dockerfile: Switched Neko base image to ghcr.io/onkernel/neko/base:3.0.6-v1.0.
  • images/chromium-headful/client/public/index.html: Removed CSS that hid the cursor, restoring the double cursor.
  • images/chromium-headful/client/src/components/connect.vue: Updated auto-login credentials to kernel/admin for KERNEL system integration.
  • images/chromium-headful/client/src/neko/index.ts: Enhanced setHeartbeat method with debugging messages and test chat functionality.
  • images/chromium-headful/neko.yaml: Configured Neko to use multiuser authentication, enabling detailed admin and user profiles with permissions.

Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What Changed

This PR addresses peer disconnection issues by switching to a custom-built neko image with a reduced heartbeat interval. A key change involves modifying the NekoClient's heartbeat mechanism in neko/index.ts to send a fake chat message, ensuring the connection remains active. Additionally, the authentication provider in neko.yaml has been updated from noauth to multiuser, with corresponding credential updates in connect.vue. Finally, based on user feedback, the double cursor has been restored by removing the cursor: none style in index.html.

Risks / Concerns

This is a great update that directly tackles the disconnection problems. The use of a fake chat message for the heartbeat is a clever workaround. While effective, we should consider creating a dedicated, long-term solution to avoid potential side effects in the future. The auth system changes look solid. Well done!

5 files reviewed | 0 comments | Review on Mesa | Edit Reviewer Settings

this.sendMessage(EVENT.CLIENT.HEARTBEAT)
this.emit('debug', `sending chat/message`)
this.sendMessage(EVENT.CHAT.MESSAGE, { content: `heartbeat/fake [${Date.now()}]` })
}, heartbeat_interval * 1000)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Heartbeat Debug Code Spamming Chat Messages

Accidentally committed debug code in the heartbeat interval sends fake chat messages with content "heartbeat/fake [timestamp]" and debug emits every heartbeat. This spams the chat interface, disrupting the user experience.

Fix in Cursor Fix in Web

Comment on lines +155 to +156
this.emit('debug', `sending chat/message`)
this.sendMessage(EVENT.CHAT.MESSAGE, { content: `heartbeat/fake [${Date.now()}]` })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@raiden-staging - just for context what's the motivation of this additional message type?

I thought we would be sufficient with just the heartbeat + server side response you added!

Copy link
Contributor

@raiden-staging raiden-staging Aug 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

( @Sayan- @rgarcia )

  • event.CLIENT_HEARTBEAT triggers new event.SYSTEM_HEARTBEAT reply from neko, but doesn't show up on websockets trace. will fix on neko/ws handler + new neko build in few.
  • event.CHAT_MESSAGE → reply is handling keepalive for now.
  • unikernel deployment seems to work well so cleanup for the above incoming 🧹✨

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Incredible - thank you again for digging into this issue!

@rgarcia rgarcia merged commit 49738dc into main Aug 4, 2025
3 checks passed
@rgarcia rgarcia deleted the peer-disconnect-fix-raf branch August 4, 2025 23:12
This was referenced Aug 5, 2025
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

Successfully merging this pull request may close these issues.

4 participants