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/wsep
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: spike/rsv-bits
Choose a base ref
...
head repository: coder/wsep
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 7 commits
  • 23 files changed
  • 5 contributors

Commits on Nov 7, 2022

  1. Merge pull request #27 from coder/spike/rsv-bits

    Fix remoteProcess race between Close and Read
    spikecurtis authored Nov 7, 2022
    Configuration menu
    Copy the full SHA
    3d408db View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2022

  1. Handle expected close errors

    Signed-off-by: Spike Curtis <spike@coder.com>
    spikecurtis committed Nov 8, 2022
    Configuration menu
    Copy the full SHA
    a6cb39d View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2022

  1. Merge pull request #28 from coder/spike/closeErrs

    Handle expected close errors
    spikecurtis authored Nov 9, 2022
    Configuration menu
    Copy the full SHA
    4c9c14e View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2022

  1. Implement reconnections with screen (#25)

    * Refactor reconnect test to support sub-tests
    
    Going to add an alternate screen test next.
    
    * Revert "Add reconnecting ptys (#23)"
    
    This partially reverts commit 9120171.
    
    The new method using screen will not share processes which is a
    fundamental shift so I think it will be easier to start from scratch.
    
    Even though we could keep the UUID check I removed it because it seems
    cool that you could create your own sessions in the terminal then
    connect to them in the browser (or vice-versa).
    
    * Add test for alternate screen
    
    The output test waits for EOF; modify that behavior so we can check that
    certain strings are not displayed *without* waiting for the timeout.
    This means to be accurate we should always check for output that should
    exist after the output that should not exist would have shown up.
    
    * Add timeout flag to dev client
    
    This makes it easier to test reconnects manually.
    
    * Add size to initial connection
    
    This way you do not need a subsequent resize and we can have the right
    size from the get-go.
    
    * Prevent prompt from rendering twice in tests
    
    * Add Nix flake
    
    * Propagate process close error
    
    * Implement reconnecting TTY with screen
    
    * Encapsulate session logic
    
    * Localize session map
    
    * Consolidate test scaffolding into helpers
    
    I think this helps make the tests a bit more concise.
    
    * Test many connections at once
    
    * Fix errors not propagating through web socket close
    
    Since the server closed the socket the caller has no chance to close
    with the right code and reason.
    
    Also abnormal closure is not a valid close code.
    
    * Fix test flake in reading output
    
    Without waiting for the copy you can sometimes get "file already
    closed".  I guess process.Wait must have some side effect.
    code-asher authored Nov 22, 2022
    Configuration menu
    Copy the full SHA
    da995d8 View commit details
    Browse the repository at this point in the history

Commits on Dec 19, 2022

  1. Fix attach resize (#29)

    * StatusAbnormalClosure cannot be set
    
    So says the warning emitted by the websocket library every time we try
    to set StatusAbnormalClosure.
    
    * Refactor screen sessions
    
    Previously we would spawn the daemon via -Dm then attach with -x once it
    was ready.  This had a flaw: the daemon starts with a hardcoded 24x80
    size and when the attach comes in it resizes and leaves a bunch of
    confusing whitespace above your prompt.
    
    Now we skip the daemon spawn and go straight for the attach but with the
    addition of -RR which lets screen spawn the daemon for us if it does
    not yet exist.
    
    Consequences:
    
    1. We can only allow one attach at a time because screen has no problem
       creating multiple daemons with the same name.
    2. IDs cannot overlap since screen will do partial matching when we do
       not include the PID which we no longer have.
    3. We do not know when the daemon exits so cleanup only happens on the
       timeout.
    4. We have to kill the session by sending the quit command through
       screen.  When we do this it is possible the session is already dead.
    5. If the daemon exits and the user reconnects before the timeout the
       daemon will be respawned all while the Go program remains blissfully
       unaware assuming it has been up this whole time.  Does not change
       anything in practice, just a bit different in terms of underlying
       architecture.
    
    In some ways this new architecture is actually simpler with roughly the
    same functionality but it does not support concurrent attaches and has a
    greater danger of desyncing from screen's own state.
    
    * Log expected/unexpected and strip ansi from tests
    
    Hopefully makes it a bit easier to see what is going on.
    
    * Add a close reason
    
    Trying to figure out why a session is prematurely closing.
    
    To do this I am setting the error via setState (so I can add the reason
    at the close call site) rather than checking for a nil error and
    returning it in the Attach.  Alternatively I was thinking of adding a
    reason arg to setState but only the close state needs a reason and
    ultimately it was transformed into the error anyway so might as well do
    it earlier and skip a step.
    
    * Increase test timeout
    
    This was canceling while the reconnect test was running.
    
    * Decrease number of concurrent test sessions
    
    Having too many seems to be causing some to exit unexpectedly.
    code-asher authored Dec 19, 2022
    Configuration menu
    Copy the full SHA
    5ba2389 View commit details
    Browse the repository at this point in the history

Commits on Jan 10, 2023

  1. Configuration menu
    Copy the full SHA
    30cd274 View commit details
    Browse the repository at this point in the history
  2. Merge pull request #30 from coder/cj/rows-cols

    fix: Command: default rows and cols if set to 0
    johnstcn authored Jan 10, 2023
    Configuration menu
    Copy the full SHA
    519f1c2 View commit details
    Browse the repository at this point in the history
Loading