Skip to content

Commit 904d942

Browse files
authored
fix remote file stream function (#1620)
1 parent d833f57 commit 904d942

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

ROADMAP.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Legend: ✅ Done | 🔧 In Progress | 🔷 Planned | 🤞 Stretch Goal
1414
- 🔷 Remote S3 bucket browsing (directory + files)
1515
- 🔷 Drag & drop between preview blocks
1616
- 🔷 Drag into a preview directory from the native file browser or desktop to copy a file
17-
- 🔷 EC-TIME timeout when transferring large files
17+
- EC-TIME timeout when transferring large files
1818
- 🤞 log viewer
1919
- 🤞 binary viewer
2020
- 🔷 Wave Apps (Go SDK)
@@ -27,7 +27,6 @@ Legend: ✅ Done | 🔧 In Progress | 🔷 Planned | 🤞 Stretch Goal
2727
- 🔷 Multi-Input between terminal blocks on the same tab
2828
- 🔧 Gemini AI support
2929
- 🔷 Monaco Theming
30-
- 🤞 Log Viewer (stretch)
3130
- 🤞 Blockcontroller fixes for terminal escape sequences
3231
- 🤞 Explore VSCode Extension Compatibility with standalone Monaco Editor (language servers)
3332
- 🔷 Various Connection Bugs + Improvements

pkg/wshrpc/wshremote/wshremote.go

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,21 @@ func (impl *ServerImpl) remoteStreamFileInternal(ctx context.Context, data wshrp
187187

188188
func (impl *ServerImpl) RemoteStreamFileCommand(ctx context.Context, data wshrpc.CommandRemoteStreamFileData) chan wshrpc.RespOrErrorUnion[wshrpc.CommandRemoteStreamFileRtnData] {
189189
ch := make(chan wshrpc.RespOrErrorUnion[wshrpc.CommandRemoteStreamFileRtnData], 16)
190-
defer close(ch)
191-
err := impl.remoteStreamFileInternal(ctx, data, func(fileInfo []*wshrpc.FileInfo, data []byte) {
192-
resp := wshrpc.CommandRemoteStreamFileRtnData{}
193-
resp.FileInfo = fileInfo
194-
if len(data) > 0 {
195-
resp.Data64 = base64.StdEncoding.EncodeToString(data)
190+
go func() {
191+
defer close(ch)
192+
err := impl.remoteStreamFileInternal(ctx, data, func(fileInfo []*wshrpc.FileInfo, data []byte) {
193+
resp := wshrpc.CommandRemoteStreamFileRtnData{}
194+
resp.FileInfo = fileInfo
195+
if len(data) > 0 {
196+
resp.Data64 = base64.StdEncoding.EncodeToString(data)
197+
}
198+
log.Printf("callback -- sending response %d\n", len(resp.Data64))
199+
ch <- wshrpc.RespOrErrorUnion[wshrpc.CommandRemoteStreamFileRtnData]{Response: resp}
200+
})
201+
if err != nil {
202+
ch <- respErr(err)
196203
}
197-
ch <- wshrpc.RespOrErrorUnion[wshrpc.CommandRemoteStreamFileRtnData]{Response: resp}
198-
})
199-
if err != nil {
200-
ch <- respErr(err)
201-
}
204+
}()
202205
return ch
203206
}
204207

0 commit comments

Comments
 (0)