tractordev / wanix

Experimental, local-first, web-native, Unix-like development environment
https://wanix.sh
MIT License
206 stars 11 forks source link

Invalid mv command input causes a panic in `syscall/js` #79

Closed taramk closed 5 months ago

taramk commented 5 months ago

image

The mv command I used here was invalid (in several ways) but the terminal just hangs and does not show the user an error.

Parzival-3141 commented 5 months ago

Looking at the console output it seems to be panicking in syscall/js. image I believe it's erroring here, where it's incorrectly trying to access a field of a string object. The error is bubbling up from the call to getFileKey. https://github.com/tractordev/wanix/blob/85b913801650a05ec3d764a91c25f40890ee497f/internal/indexedfs/indexedfs.go#L248-L251 Which is weird considering getFileKey does return an Error object on rejection: https://github.com/tractordev/wanix/blob/85b913801650a05ec3d764a91c25f40890ee497f/internal/indexedfs/indexedfs.js#L131