pervane icon indicating copy to clipboard operation
pervane copied to clipboard

File errors silently fail and not reported to the web browser

Open clach04 opened this issue 3 years ago • 1 comments

Loading files will fail with an exception that's visible in the server log but not to the end user in the browser. If the web browser debug console is opened and errors are displayed there is some information but its essentially hidden from the user.

test case, on server in note directory:

sudo bash
# echo root_owned_file > root_owned_file.txt
# ls -alr root_owned_file.txt
-rw-r--r-- 1 root root 16 Jul 10 10:29 root_owned_file.txt
# chmod 700 root_owned_file.txt
# ls -alr root_owned_file.txt
-rwx------ 1 root root 16 Jul 10 10:29 root_owned_file.txt

try and open file in web browser. Nothing appears to happen in browser.

Open web browser console and display errors:

root_owned_file.txt:1 Failed to load resource: the server responded with a status of 500 (INTERNAL SERVER ERROR)

Same error whether debug on or off when starting server.

Server log:

PermissionError: [Errno 13] Permission denied: '...pervane/example/root_owned_file.txt'
ERROR:root:There is an error while reading: ...pervane/example/root_owned_file.txt. Error: [Errno 13] Permission denied: '...pervane/example/root_owned_file.txt'

clach04 avatar Jul 10 '21 17:07 clach04

We should have a streamlined messaging pipeline from backend to frontend alongside with the heartbeats. UI should know that the connection is gone away from backend and new note modifications may be stale.

Related: #147

hakanu avatar Jul 16 '21 16:07 hakanu