fix remote file stream function (#1620)

This commit is contained in:
Mike Sawka 2024-12-26 10:23:28 -08:00 committed by GitHub
parent d833f57214
commit 904d942c4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 13 deletions

View File

@ -14,7 +14,7 @@ Legend: ✅ Done | 🔧 In Progress | 🔷 Planned | 🤞 Stretch Goal
- 🔷 Remote S3 bucket browsing (directory + files) - 🔷 Remote S3 bucket browsing (directory + files)
- 🔷 Drag & drop between preview blocks - 🔷 Drag & drop between preview blocks
- 🔷 Drag into a preview directory from the native file browser or desktop to copy a file - 🔷 Drag into a preview directory from the native file browser or desktop to copy a file
- 🔷 EC-TIME timeout when transferring large files - EC-TIME timeout when transferring large files
- 🤞 log viewer - 🤞 log viewer
- 🤞 binary viewer - 🤞 binary viewer
- 🔷 Wave Apps (Go SDK) - 🔷 Wave Apps (Go SDK)
@ -27,7 +27,6 @@ Legend: ✅ Done | 🔧 In Progress | 🔷 Planned | 🤞 Stretch Goal
- 🔷 Multi-Input between terminal blocks on the same tab - 🔷 Multi-Input between terminal blocks on the same tab
- 🔧 Gemini AI support - 🔧 Gemini AI support
- 🔷 Monaco Theming - 🔷 Monaco Theming
- 🤞 Log Viewer (stretch)
- 🤞 Blockcontroller fixes for terminal escape sequences - 🤞 Blockcontroller fixes for terminal escape sequences
- 🤞 Explore VSCode Extension Compatibility with standalone Monaco Editor (language servers) - 🤞 Explore VSCode Extension Compatibility with standalone Monaco Editor (language servers)
- 🔷 Various Connection Bugs + Improvements - 🔷 Various Connection Bugs + Improvements

View File

@ -187,18 +187,21 @@ func (impl *ServerImpl) remoteStreamFileInternal(ctx context.Context, data wshrp
func (impl *ServerImpl) RemoteStreamFileCommand(ctx context.Context, data wshrpc.CommandRemoteStreamFileData) chan wshrpc.RespOrErrorUnion[wshrpc.CommandRemoteStreamFileRtnData] { func (impl *ServerImpl) RemoteStreamFileCommand(ctx context.Context, data wshrpc.CommandRemoteStreamFileData) chan wshrpc.RespOrErrorUnion[wshrpc.CommandRemoteStreamFileRtnData] {
ch := make(chan wshrpc.RespOrErrorUnion[wshrpc.CommandRemoteStreamFileRtnData], 16) ch := make(chan wshrpc.RespOrErrorUnion[wshrpc.CommandRemoteStreamFileRtnData], 16)
defer close(ch) go func() {
err := impl.remoteStreamFileInternal(ctx, data, func(fileInfo []*wshrpc.FileInfo, data []byte) { defer close(ch)
resp := wshrpc.CommandRemoteStreamFileRtnData{} err := impl.remoteStreamFileInternal(ctx, data, func(fileInfo []*wshrpc.FileInfo, data []byte) {
resp.FileInfo = fileInfo resp := wshrpc.CommandRemoteStreamFileRtnData{}
if len(data) > 0 { resp.FileInfo = fileInfo
resp.Data64 = base64.StdEncoding.EncodeToString(data) if len(data) > 0 {
resp.Data64 = base64.StdEncoding.EncodeToString(data)
}
log.Printf("callback -- sending response %d\n", len(resp.Data64))
ch <- wshrpc.RespOrErrorUnion[wshrpc.CommandRemoteStreamFileRtnData]{Response: resp}
})
if err != nil {
ch <- respErr(err)
} }
ch <- wshrpc.RespOrErrorUnion[wshrpc.CommandRemoteStreamFileRtnData]{Response: resp} }()
})
if err != nil {
ch <- respErr(err)
}
return ch return ch
} }