detached 261a65d

fix(client): end the held-input overflow only once an attachment begins

Clearing it at stream open let a later failure (deadline, worker, Begin) start another resume phase that accepted keys again after dropped ones.
commit
261a65d3c543ad6084761acecba81ec2690836f4
author
brice · · 2026-10-08 06:22 UTC
committer
brice · · 2026-10-08 06:24 UTC
parent
08ceb7f
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
1 file · +5 -4
M internal/usecase/client/supervisor_attach.go +5 -4
@@ -779,10 +779,6 @@ func (s *Supervisor) attachResolved(ctx context.Context, input *terminalInputLif
779779 if supervisorNil(stream) {
780780 return s.attemptFailed(ports.BrokerError{Code: ports.BrokerErrorUnavailable, Text: "broker returned no stream"}, resuming)
781781 }
782- if input != nil {
783- // The outage ended: keys typed from now on reach the session again.
784- input.resumeOverflowed.Store(false)
785- }
786782 if err := deadline.adopt(stream); err != nil {
787783 // The accepted absolute deadline already elapsed before this client
788784 // saw the stream. Fail the attachment instead of restarting a budget.
@@ -818,6 +814,11 @@ func (s *Supervisor) attachResolved(ctx context.Context, input *terminalInputLif
818814 s.transition(supervisorEvent{kind: supervisorAttachEnded})
819815 return attachmentEndedOutcome()
820816 }
817+ if input != nil {
818+ // The attachment owns input again: keys typed from now on reach the
819+ // session, so the outage's overflow ends here, not at stream open.
820+ input.resumeOverflowed.Store(false)
821+ }
821822 return s.settleAttachment(ctx, input, service, deadline, run, request, resuming)
822823 }
823824
@@ -779,10 +779,6 @@ func (s *Supervisor) attachResolved(ctx context.Context, input *terminalInputLif
779 if supervisorNil(stream) {779 if supervisorNil(stream) {
780 return s.attemptFailed(ports.BrokerError{Code: ports.BrokerErrorUnavailable, Text: "broker returned no stream"}, resuming)780 return s.attemptFailed(ports.BrokerError{Code: ports.BrokerErrorUnavailable, Text: "broker returned no stream"}, resuming)
781 }781 }
782- if input != nil {
783- // The outage ended: keys typed from now on reach the session again.
784- input.resumeOverflowed.Store(false)
785- }
786 if err := deadline.adopt(stream); err != nil {782 if err := deadline.adopt(stream); err != nil {
787 // The accepted absolute deadline already elapsed before this client783 // The accepted absolute deadline already elapsed before this client
788 // saw the stream. Fail the attachment instead of restarting a budget.784 // saw the stream. Fail the attachment instead of restarting a budget.
@@ -818,6 +814,11 @@ func (s *Supervisor) attachResolved(ctx context.Context, input *terminalInputLif
818 s.transition(supervisorEvent{kind: supervisorAttachEnded})814 s.transition(supervisorEvent{kind: supervisorAttachEnded})
819 return attachmentEndedOutcome()815 return attachmentEndedOutcome()
820 }816 }
817+ if input != nil {
818+ // The attachment owns input again: keys typed from now on reach the
819+ // session, so the outage's overflow ends here, not at stream open.
820+ input.resumeOverflowed.Store(false)
821+ }
821 return s.settleAttachment(ctx, input, service, deadline, run, request, resuming)822 return s.settleAttachment(ctx, input, service, deadline, run, request, resuming)
822 }823 }
823 824

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 12

Tags 11

↑↓ moveenter openesc close