ARK-Builders/ARK-Shelf-Desktop

Long URLs cause crash

kirillt opened this issue · 1 comments

Because URLs are pasted into filename.

Example: adding https://2501babe.github.io/posts/solana101.html?accessToken=eyJhbGciOiJIUzI1NiIsImtpZCI6ImRlZmF1bHQiLCJ0eXAiOiJKV1QifQ.eyJhdWQiOiJhY2Nlc3NfcmVzb3VyY2UiLCJleHAiOjE2NDQ0ODUzOTUsImciOiI4QXcyeDJNQTJrUVVYdnYwIiwiaWF0IjoxNjQ0NDg1MDk1LCJ1c2VySWQiOi0xNzQ4NDU1ODc5fQ.poTnBB48mQjZhiun-HoSCPNG5pXLBoup42GxUMuSiMI leads to

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 36, kind: InvalidFilename, message: "File name too long" }', core/src/base/link.rs:31:44
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

We should encode URL with some hash function or BASE 32. We can use UUID or timestamps as well but then we need to check duplicates.

Fixed in #11