debug: add onmessage logging to useSftp composable

This commit is contained in:
Vantz Stockwell 2026-03-14 02:34:58 -04:00
parent e39d8fbdda
commit 3b5e5e0d36

View File

@ -31,7 +31,9 @@ export function useSftp(sessionId: Ref<string | null>) {
} }
ws.onmessage = (event) => { ws.onmessage = (event) => {
console.log('[SFTP] WS message received, raw length:', event.data?.length, 'type:', typeof event.data)
const msg = JSON.parse(event.data) const msg = JSON.parse(event.data)
console.log('[SFTP] Parsed message type:', msg.type, 'entries:', msg.entries?.length)
switch (msg.type) { switch (msg.type) {
case 'list': case 'list':
entries.value = msg.entries.sort((a: any, b: any) => { entries.value = msg.entries.sort((a: any, b: any) => {
@ -39,6 +41,7 @@ export function useSftp(sessionId: Ref<string | null>) {
return a.name.localeCompare(b.name) return a.name.localeCompare(b.name)
}) })
currentPath.value = msg.path currentPath.value = msg.path
console.log('[SFTP] entries.value set, count:', entries.value.length)
break break
case 'fileContent': case 'fileContent':
fileContent.value = { path: msg.path, content: msg.content } fileContent.value = { path: msg.path, content: msg.content }