Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: coder/websocket
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d099e16
Choose a base ref
...
head repository: coder/websocket
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0c8afd9
Choose a head ref
  • 6 commits
  • 2 files changed
  • 2 contributors

Commits on Dec 17, 2025

  1. fix: transmit in single frame when compression enabled

    Closes #435
    
    ### Problem
    
    When compression was enabled, `Conn.Write` sent messages across many small frames due to the flate library's internal `bufferFlushSize` (240 bytes). Each flush triggered a `writeFrame` call, producing alternating ~236 and 4 byte frames. This broke clients like Unreal Engine that only process one frame per tick.
    
    ### Solution
    
    `Conn.Write` now compresses the entire message into a buffer first, then transmits it as a single frame. Messages below `flateThreshold` bypass compression and are sent uncompressed in a single frame.
    
    For `CompressionContextTakeover` mode, the flateWriter destination is restored after buffered compression to ensure subsequent `Writer()` streaming calls work correctly.
    
    ### Changes
    
    - **write.go**: Buffer compressed output before transmission
    - **compress_test.go**: Added regression tests for single-frame behavior and Write/Writer interop
    DanielleMaywood committed Dec 17, 2025
    Configuration menu
    Copy the full SHA
    f05d80c View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2025

  1. chore: PR comments

    - humanize some comments/remove lots of unneeded ones
    - refactor write
    - ensure we close?
    DanielleMaywood committed Dec 19, 2025
    Configuration menu
    Copy the full SHA
    eef8394 View commit details
    Browse the repository at this point in the history
  2. chore: address PR comments

    - compression_test.go: add a `Writer` -> `Write` transition
    - compression_test.go: Claude sucks at variable names apparently
    - write.go: make sure to hold a lock 🤦
    - write.go: combine two identical if branches
    - write.go: rename `writeFull` because the name was bad
    DanielleMaywood committed Dec 19, 2025
    Configuration menu
    Copy the full SHA
    885bd0d View commit details
    Browse the repository at this point in the history
  3. appease maf's eyesight

    Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
    DanielleMaywood and mafredri authored Dec 19, 2025
    Configuration menu
    Copy the full SHA
    2aa28fb View commit details
    Browse the repository at this point in the history
  4. appease maf's eyesight

    Co-authored-by: Mathias Fredriksson <mafredri@gmail.com>
    DanielleMaywood and mafredri authored Dec 19, 2025
    Configuration menu
    Copy the full SHA
    67220ee View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    0c8afd9 View commit details
    Browse the repository at this point in the history
Loading