Thanks to visit codestin.com
Credit goes to github.com

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/coder
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v2.28.7
Choose a base ref
...
head repository: coder/coder
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v2.28.8
Choose a head ref
  • 1 commit
  • 1 file changed
  • 2 contributors

Commits on Jan 26, 2026

  1. fix(coderd): ensure inbox WebSocket is closed when client disconnects… (

    #21685)
    
    … (#21652)
    
    Relates to #19715
    
    This is similar to #19711
    
    This endpoint works by doing the following:
    - Subscribing to the database's with pubsub
    - Accepts a WebSocket upgrade
    - Starts a `httpapi.Heartbeat`
    - Creates a json encoder
    - **Infinitely loops waiting for notification until request context
    cancelled**
    
    The critical issue here is that `httpapi.Heartbeat` silently fails when
    the client has disconnected. This means we never cancel the request
    context, leaving the WebSocket alive until we receive a notification
    from the database and fail to write that down the pipe.
    
    By replacing usage of `httpapi.Heartbeat` with `httpapi.HeartbeatClose`,
    we cancel the context _when the heartbeat fails to write_ due to the
    client disconnecting. This allows us to cleanup without waiting for a
    notification to come through the pubsub channel.
    
    (cherry picked from commit 409360c)
    
    <!--
    
    If you have used AI to produce some or all of this PR, please ensure you
    have read our [AI Contribution
    guidelines](https://coder.com/docs/about/contributing/AI_CONTRIBUTING)
    before submitting.
    
    -->
    
    Co-authored-by: Danielle Maywood <[email protected]>
    johnstcn and DanielleMaywood authored Jan 26, 2026
    Configuration menu
    Copy the full SHA
    cc88b0f View commit details
    Browse the repository at this point in the history
Loading