Closed drewauff closed 3 years ago
@drewauff Thanks for reporting. Would you mind sharing the debug log from when this happens (obviously, redact anything personal/private from it)? Default location is ~/.sncli/sncli.log
.
I'm inclined to make a few observations:
Short-term solution: stricter sanitizing and checking at cache initialization. A longer solution as I see it would be to encapsulate the impl. details and usage patterns of a note in its own class, with proper sanitizing done there. I'd be willing to take a shot at it. Could give way to some healthy separation of concerns, code tidying, some tests like the official electron project does.
What's your take on it @swalladge?
@ThisSentenceIsFalse to be honest, I think if the notes cache (really the notes database; sncli can work without a simplenote server) are edited by anything other than the app's internal operations, then crashing is ok. Raw editing notes is only supposed to be for an escape hatch if one really wishes to do something advanced that the app doesn't support. As with any app, if you mess with the data files outside of the app, then there will likely be consequences; I'm not sure extra sanitization or checking will be productive here.
importing notes does some more substantial checks, for good reasons - in my view, these reasons apply to cache-loading as well
Yes, because importing notes assumes untrusted data - it needs to do a best effort to successfully and safely import data into the internal format. Loading from the database is a trusted operation because it's within the bounds of the application. Yes it can be maliciously/accidentally edited, but so can the RAM that the live app is running in. ¯\_(ツ)_/¯
A longer solution as I see it would be to encapsulate the impl. details and usage patterns of a note in its own class, with proper sanitizing done there. I'd be willing to take a shot at it. Could give way to some healthy separation of concerns, code tidying, some tests like the official electron project does.
This would be awesome! I'm all for adding tests and tidying the code. If you'd like to give it a shot, then please do! :+1:
I tried deleting..well I renamed the .sncli DIR and now getting this error
2020-11-30 11:04:48,428 [DEBUG] sncli logging initialized 2020-11-30 11:04:48,464 [DEBUG] Starting new HTTPS connection (1): auth.simperium.com:443 2020-11-30 11:04:49,120 [DEBUG] https://auth.simperium.com:443 "POST /1/chalk-bump-f49/authorize/ HTTP/1.1" 401 None 2020-11-30 11:04:49,123 [DEBUG] Auth error: 401 Client Error: UNAUTHORIZED for url: https://auth.simperium.com/1/chalk-bump-f49/authorize/ 2020-11-30 11:04:49,123 [DEBUG] sncli database doesn't exist, forcing full sync... 2020-11-30 11:04:49,123 [DEBUG] Starting full sync 2020-11-30 11:04:49,123 [DEBUG] ERROR: Failed to get note list from server 2020-11-30 11:04:49,123 [DEBUG] Full sync completed 2020-11-30 11:04:50,150 [DEBUG] Sync worker: started 2020-11-30 11:04:50,150 [DEBUG] Starting full sync 2020-11-30 11:04:50,151 [DEBUG] ERROR: Failed to get note list from server 2020-11-30 11:04:50,151 [DEBUG] Full sync completed 2020-11-30 11:05:05,156 [DEBUG] Starting full sync 2020-11-30 11:05:05,156 [DEBUG] ERROR: Failed to get note list from server 2020-11-30 11:05:05,157 [DEBUG] Full sync completed 2020-11-30 11:05:21,237 [DEBUG] sncli logging initialized 2020-11-30 11:05:21,251 [DEBUG] Starting new HTTPS connection (1): auth.simperium.com:443 2020-11-30 11:05:21,885 [DEBUG] https://auth.simperium.com:443 "POST /1/chalk-bump-f49/authorize/ HTTP/1.1" 401 None 2020-11-30 11:05:21,888 [DEBUG] Auth error: 401 Client Error: UNAUTHORIZED for url: https://auth.simperium.com/1/chalk-bump-f49/authorize/ 2020-11-30 11:05:22,901 [DEBUG] Sync worker: started 2020-11-30 11:05:22,901 [DEBUG] Starting full sync 2020-11-30 11:05:22,902 [DEBUG] ERROR: Failed to get note list from server 2020-11-30 11:05:22,902 [DEBUG] Full sync completed
@drewauff that looks like your user credentials are incorrect. Could you verify and recheck?
OMG Works now, don't know what was tripping it previously, that's why i decided to uninstall and rename the .sncli dir.
Awesome, thank you for all your help..just noticed your a fellow Aussie lol, explains the quick response.
Thanks again and good to see this isn't dead.
@drewauff :+1: :+1:
I'll close this since the issue has resolved itself. Feel free to reopen or open a new issue if it comes back, and we can investigate it further. :)
MacOS Catalina iTerm2
error is as follows :