update statediff algorithm for wavesrv / remote instances (#530)

* remote statemap from waveshell server (diff against initial state)

* move ShellStatePtr from sstore to packet so it can be passed over the wire

* add finalstatebaseptr to cmddone

* much improved diff computation code on wavesrv side

* fix displayname -- now using hash

* add comments, change a couple msh.WriteToPtyBuffer calls to log.Printfs
This commit is contained in:
Mike Sawka
2024-03-28 16:56:39 -07:00
committed by GitHub
parent 5c85b2b786
commit a1e4e807cc
12 changed files with 182 additions and 108 deletions
+3 -2
View File
@@ -12,6 +12,7 @@ import (
"strings"
"github.com/google/uuid"
"github.com/wavetermdev/waveterm/waveshell/pkg/packet"
"github.com/wavetermdev/waveterm/wavesrv/pkg/remote"
"github.com/wavetermdev/waveterm/wavesrv/pkg/scpacket"
"github.com/wavetermdev/waveterm/wavesrv/pkg/sstore"
@@ -42,7 +43,7 @@ type ResolvedRemote struct {
RState remote.RemoteRuntimeState
RemoteCopy *sstore.RemoteType
ShellType string // default remote shell preference
StatePtr *sstore.ShellStatePtr
StatePtr *packet.ShellStatePtr
FeState map[string]string
}
@@ -491,7 +492,7 @@ func ResolveRemoteFromPtr(ctx context.Context, rptr *sstore.RemotePtrType, sessi
rtn.StatePtr = nil
rtn.FeState = nil
} else {
rtn.StatePtr = &sstore.ShellStatePtr{BaseHash: ri.StateBaseHash, DiffHashArr: ri.StateDiffHashArr}
rtn.StatePtr = &packet.ShellStatePtr{BaseHash: ri.StateBaseHash, DiffHashArr: ri.StateDiffHashArr}
rtn.FeState = ri.FeState
rtn.ShellType = ri.ShellType
}