fix(navigation): send local attach targets before detach
- commit
- 5ed306ee21e72b90a6d9b7c339e3093ffa16a56d
- author
- brice · · 2026-08-11 09:31 UTC
- parent
- 64bb8b2
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +1 -6
M internal/usecase/daemon/picker.go +0 -5
| @@ -896,11 +896,6 @@ func (d *Daemon) switchToTargetForAttachment(token attachmentConnectionToken, ta | |||
| 896 | 896 | if target.RemoteKey != nil { | |
| 897 | 897 | return d.sendRemoteAttachTargetForAttachment(token, target, *target.RemoteKey, guard, action) | |
| 898 | 898 | } | |
| 899 | - | token.effect.bindActionEnd(d, action) | |
| 900 | - | token.effect.End() | |
| 901 | - | if !token.attachmentCurrent() { | |
| 902 | - | return errAttachmentTransition | |
| 903 | - | } | |
| 904 | 899 | return d.sendLocalAttachTargetForAttachment(token, target, guard, action) | |
| 905 | 900 | } | |
| 906 | 901 | ||
| @@ -896,11 +896,6 @@ func (d *Daemon) switchToTargetForAttachment(token attachmentConnectionToken, ta | |||||
| 896 | if target.RemoteKey != nil { | 896 | if target.RemoteKey != nil { | ||
| 897 | return d.sendRemoteAttachTargetForAttachment(token, target, *target.RemoteKey, guard, action) | 897 | return d.sendRemoteAttachTargetForAttachment(token, target, *target.RemoteKey, guard, action) | ||
| 898 | } | 898 | } | ||
| 899 | - | token.effect.bindActionEnd(d, action) | |||
| 900 | - | token.effect.End() | |||
| 901 | - | if !token.attachmentCurrent() { | |||
| 902 | - | return errAttachmentTransition | |||
| 903 | - | } | |||
| 904 | return d.sendLocalAttachTargetForAttachment(token, target, guard, action) | 899 | return d.sendLocalAttachTargetForAttachment(token, target, guard, action) | ||
| 905 | } | 900 | } | ||
| 906 | 901 | ||||
M internal/usecase/daemon/remote_attach_test.go +1 -1
| @@ -28,7 +28,7 @@ func TestLocalPickerHandoffCarriesExactLifecycle(t *testing.T) { | |||
| 28 | 28 | token.effect = effect | |
| 29 | 29 | defer effect.End() | |
| 30 | 30 | ||
| 31 | - | require.NoError(t, d.sendLocalAttachTargetForAttachment(token, picker.Target{Session: target.id}, sessionHandoffGuard{}, "picker-select")) | |
| 31 | + | require.NoError(t, d.switchToTargetForAttachment(token, picker.Target{Session: target.id}, sessionHandoffGuard{}, "picker-select")) | |
| 32 | 32 | frame := receiveRemotePicker(t, sends, "local attach target") | |
| 33 | 33 | got, err := ports.UnmarshalAttachTarget(frame.Payload) | |
| 34 | 34 | require.NoError(t, err) | |
| @@ -28,7 +28,7 @@ func TestLocalPickerHandoffCarriesExactLifecycle(t *testing.T) { | |||||
| 28 | token.effect = effect | 28 | token.effect = effect | ||
| 29 | defer effect.End() | 29 | defer effect.End() | ||
| 30 | 30 | ||||
| 31 | - | require.NoError(t, d.sendLocalAttachTargetForAttachment(token, picker.Target{Session: target.id}, sessionHandoffGuard{}, "picker-select")) | 31 | + | require.NoError(t, d.switchToTargetForAttachment(token, picker.Target{Session: target.id}, sessionHandoffGuard{}, "picker-select")) |
| 32 | frame := receiveRemotePicker(t, sends, "local attach target") | 32 | frame := receiveRemotePicker(t, sends, "local attach target") | ||
| 33 | got, err := ports.UnmarshalAttachTarget(frame.Payload) | 33 | got, err := ports.UnmarshalAttachTarget(frame.Payload) | ||
| 34 | require.NoError(t, err) | 34 | require.NoError(t, err) | ||