Commit Graph
16 Commits
Author SHA1 Message Date
realrasengan 534e7da40d fix state tracker desync: prune by throwawayNum instead of arbitrary limit 2026-03-31 17:34:29 -07:00
realrasengan aff8e0572a fix resize: accept first diff after reset without base state 2026-03-30 21:24:44 -07:00
realrasengan f70f18fc3f add DialConnRaw + RecvRaw for direct transport access in WASM 2026-03-30 20:55:37 -07:00
realrasengan 8d9bc2eba0 add framebuffer state tracking to WASM client (match Dart)
- Transport: expose LastRecvOldNum/LastRecvNewNum for state tracking
- WASM: stateTracker with shadow VT emulator and received states map
- Each diff applied to base state copy, stored by newNum
- Display diffing: only changed cells sent to terminal
- Eliminates garbled output from missed diffs and state transitions
- Build with -tags osusergo for WASM os/user compatibility
2026-03-30 20:47:18 -07:00
realrasengan b71a9c5824 fix key repeat: only create new state when previous is acked (match Dart client)
The Dart mosh client only calls sendNew() when hasPendingState is false.
The Go client was calling SetPending on every tick with dirty=true, which
reset diffSent and caused new sequence numbers for the same cumulative
payload. Now tick() checks AckedByRemote >= SentNum before calling
SetPending — at most one unacked state in flight, matching the Dart
client's behavior.
2026-03-30 19:56:45 -07:00
realrasengan c582e52c15 WASM: replace goroutine recv with JS-driven poll() to prevent scheduler starvation 2026-03-30 18:53:48 -07:00
realrasengan ad1792735e WASM: tick immediately when idle, batch when ack pending 2026-03-30 18:45:45 -07:00
realrasengan 1694f8c993 WASM: remove tick from send, let interval handle all flushing 2026-03-30 18:44:31 -07:00
realrasengan ecc46b8df2 WASM: batch keystrokes per animation frame to prevent cumulative state duplication 2026-03-30 17:25:05 -07:00
realrasengan 83b9ce0de5 WASM: defer next datagram read via setTimeout to yield to Go scheduler 2026-03-30 16:42:33 -07:00
realrasengan 37159d31bd WASM: use persistent writer, fix connection lost from lock churn 2026-03-30 16:19:17 -07:00
realrasengan 30eb6a82a5 WASM: tick immediately on send/resize, slow keepalive interval only 2026-03-30 16:07:58 -07:00
realrasengan cc1f22485d remove immediate Tick from send/resize — let setInterval drive it 2026-03-30 15:43:33 -07:00
realrasengan d8d48e4269 fix WASM: self-chaining JS reader, no goroutine leak, per-write lock 2026-03-30 14:35:40 -07:00
realrasengan 5f8cade139 add Tick() export and DialConnManual for JS-driven send loop in WASM 2026-03-30 14:24:44 -07:00
realrasengan bbe416444b add Conn interface, WASM client with WebTransport transport
- Conn interface: abstracts datagram I/O (Read/Write/SetReadDeadline/Close)
- Client.DialConn(): create client over any Conn (not just UDP)
- cmd/mosh-wasm: WASM binary exposing moshConnect(url, key) to JS
- WebTransport adapter: browser datagrams as mosh.Conn
- Build tags: server.go and framebuffer.go excluded from js/wasm
- Shared constants moved to conn.go

Existing UDP paths unchanged. Latch unaffected.
2026-03-30 12:05:33 -07:00