From c499942028c2f58fdaa67cd182f9cc76bb14bb6f Mon Sep 17 00:00:00 2001 From: abose Date: Tue, 23 Jul 2024 20:49:07 +0530 Subject: [PATCH] feat: app crash reporting in rust layer and redirect to support page on crash --- src-tauri/Cargo.lock | 525 ++++++++++++++++++++++++++++++++++-------- src-tauri/Cargo.toml | 3 + src-tauri/src/main.rs | 48 ++++ 3 files changed, 476 insertions(+), 100 deletions(-) diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index dca5f5e6..4ee85a4e 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -71,7 +71,7 @@ dependencies = [ "clipboard-win 5.3.0", "core-graphics 0.23.1", "image", - "log", + "log 0.4.21", "objc", "objc-foundation", "objc_id", @@ -139,10 +139,10 @@ checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ "async-lock 2.8.0", "autocfg", - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "futures-lite 1.13.0", - "log", + "log 0.4.21", "parking", "polling 2.8.0", "rustix 0.37.27", @@ -158,7 +158,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" dependencies = [ "async-lock 3.3.0", - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "futures-io", "futures-lite 2.3.0", @@ -200,7 +200,7 @@ dependencies = [ "async-lock 2.8.0", "async-signal", "blocking", - "cfg-if", + "cfg-if 1.0.0", "event-listener 3.1.0", "futures-lite 1.13.0", "rustix 0.38.32", @@ -227,7 +227,7 @@ dependencies = [ "async-io 2.3.2", "async-lock 2.8.0", "atomic-waker", - "cfg-if", + "cfg-if 1.0.0", "futures-core", "futures-io", "rustix 0.38.32", @@ -291,7 +291,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi 0.1.19", "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -308,13 +308,23 @@ checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", - "cfg-if", + "cfg-if 1.0.0", "libc", "miniz_oxide", "object", "rustc-demangle", ] +[[package]] +name = "base64" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" +dependencies = [ + "byteorder", + "safemem", +] + [[package]] name = "base64" version = "0.13.1" @@ -419,6 +429,20 @@ dependencies = [ "serde", ] +[[package]] +name = "bugsnag" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20015af8027d22db67e2c84f8b9f2c31b1efa0ec554d8b210c77acb7065d69bf" +dependencies = [ + "backtrace", + "hyper 0.10.16", + "serde", + "serde_derive", + "serde_json", + "sys-info", +] + [[package]] name = "bumpalo" version = "3.15.4" @@ -522,6 +546,12 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + [[package]] name = "cfg-if" version = "1.0.0" @@ -593,7 +623,7 @@ checksum = "7191c27c2357d9b7ef96baac1773290d4ca63b24205b82a3fd8a0637afcf0362" dependencies = [ "error-code 2.3.1", "str-buf", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -734,7 +764,7 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -818,14 +848,38 @@ dependencies = [ "syn 2.0.55", ] +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + [[package]] name = "darling" version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54e36fcd13ed84ffdfda6f5be89b31287cbb80c439841fe69e04841435464391" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.8", + "darling_macro 0.20.8", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", ] [[package]] @@ -842,13 +896,24 @@ dependencies = [ "syn 2.0.55", ] +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core 0.13.4", + "quote", + "syn 1.0.109", +] + [[package]] name = "darling_macro" version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a668eda54683121533a393014d8692171709ff57a7d61f187b6e782719f8933f" dependencies = [ - "darling_core", + "darling_core 0.20.8", "quote", "syn 2.0.55", ] @@ -898,6 +963,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "dialog" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736bab36d647d14c985725a57a4110a1182c6852104536cd42f1c97e96d29bf0" +dependencies = [ + "dirs 2.0.2", + "rpassword", +] + [[package]] name = "digest" version = "0.10.7" @@ -908,13 +983,23 @@ dependencies = [ "crypto-common", ] +[[package]] +name = "dirs" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" +dependencies = [ + "cfg-if 0.1.10", + "dirs-sys 0.3.7", +] + [[package]] name = "dirs" version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ - "dirs-sys", + "dirs-sys 0.4.1", ] [[package]] @@ -923,10 +1008,21 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "dirs-sys-next", ] +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi 0.3.9", +] + [[package]] name = "dirs-sys" version = "0.4.1" @@ -947,7 +1043,7 @@ checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -1018,7 +1114,7 @@ version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -1173,7 +1269,7 @@ version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "redox_syscall", "windows-sys 0.52.0", @@ -1258,7 +1354,7 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ - "percent-encoding", + "percent-encoding 2.3.1", ] [[package]] @@ -1474,7 +1570,7 @@ checksum = "5cc16584ff22b460a382b7feec54b23d2908d858152e5739a120b949293bd74e" dependencies = [ "cc", "libc", - "log", + "log 0.4.21", "rustversion", "windows 0.48.0", ] @@ -1486,7 +1582,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", - "version_check", + "version_check 0.9.4", ] [[package]] @@ -1505,7 +1601,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] @@ -1516,7 +1612,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "wasi 0.11.0+wasi-snapshot-preview1", ] @@ -1554,7 +1650,7 @@ dependencies = [ "gobject-sys", "libc", "system-deps 6.2.2", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -1616,7 +1712,7 @@ checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1" dependencies = [ "aho-corasick", "bstr", - "log", + "log 0.4.21", "regex-automata 0.4.6", "regex-syntax 0.8.2", ] @@ -1775,7 +1871,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bea68cab48b8459f17cf1c944c67ddc572d272d9f2b274140f223ecb1da4a3b7" dependencies = [ - "log", + "log 0.4.21", "mac", "markup5ever", "proc-macro2", @@ -1823,6 +1919,25 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "hyper" +version = "0.10.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a0652d9a2609a968c14be1a9ea00bf4b1d64e2e1f53a1b51b6fff3a6e829273" +dependencies = [ + "base64 0.9.3", + "httparse", + "language-tags", + "log 0.3.9", + "mime 0.2.6", + "num_cpus", + "time 0.1.45", + "traitobject", + "typeable", + "unicase", + "url 1.7.2", +] + [[package]] name = "hyper" version = "0.14.28" @@ -1854,7 +1969,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.28", "native-tls", "tokio", "tokio-native-tls", @@ -1899,6 +2014,17 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "idna" version = "0.5.0" @@ -1917,7 +2043,7 @@ checksum = "b46810df39e66e925525d6e38ce1e7f6e1d208f72dc39757880fcb66e2c58af1" dependencies = [ "crossbeam-deque", "globset", - "log", + "log 0.4.21", "memchr", "regex-automata 0.4.6", "same-file", @@ -1976,7 +2102,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", ] [[package]] @@ -1985,11 +2111,11 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81f2533f3be42fffe3b5e63b71aeca416c1c3bc33e4e27be018521e76b1f38fb" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "rustc_version", "to_method", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -2044,6 +2170,20 @@ dependencies = [ "system-deps 5.0.0", ] +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log 0.4.21", + "thiserror", + "walkdir", +] + [[package]] name = "jni" version = "0.20.0" @@ -2053,7 +2193,7 @@ dependencies = [ "cesu8", "combine", "jni-sys", - "log", + "log 0.4.21", "thiserror", "walkdir", ] @@ -2091,6 +2231,16 @@ dependencies = [ "treediff", ] +[[package]] +name = "kernel32-sys" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" +dependencies = [ + "winapi 0.2.8", + "winapi-build", +] + [[package]] name = "kuchikiki" version = "0.8.2" @@ -2104,6 +2254,12 @@ dependencies = [ "selectors", ] +[[package]] +name = "language-tags" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" + [[package]] name = "lazy_static" version = "1.5.0" @@ -2122,7 +2278,7 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "windows-targets 0.52.5", ] @@ -2165,6 +2321,15 @@ dependencies = [ "scopeguard", ] +[[package]] +name = "log" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" +dependencies = [ + "log 0.4.21", +] + [[package]] name = "log" version = "0.4.21" @@ -2177,7 +2342,7 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff50ecb28bb86013e935fb6683ab1f6d3a20016f123c76fd4c27470076ac30f5" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "generator", "scoped-tls", "serde", @@ -2202,7 +2367,7 @@ dependencies = [ "dirs-next", "objc-foundation", "objc_id", - "time", + "time 0.3.34", ] [[package]] @@ -2220,7 +2385,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a2629bb1404f3d34c2e921f21fd34ba00b206124c81f65c50b43b6aaefeb016" dependencies = [ - "log", + "log 0.4.21", "phf 0.10.1", "phf_codegen 0.10.0", "string_cache", @@ -2267,6 +2432,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "mime" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" +dependencies = [ + "log 0.3.9", +] + [[package]] name = "mime" version = "0.3.17" @@ -2314,7 +2488,7 @@ checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", - "log", + "log 0.4.21", "openssl", "openssl-probe", "openssl-sys", @@ -2343,6 +2517,34 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" +[[package]] +name = "ndk-glue" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d0c4a7b83860226e6b4183edac21851f05d5a51756e97a1144b7f5a6b63e65f" +dependencies = [ + "lazy_static", + "libc", + "log 0.4.21", + "ndk", + "ndk-context", + "ndk-macro", + "ndk-sys", +] + +[[package]] +name = "ndk-macro" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" +dependencies = [ + "darling 0.13.4", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "ndk-sys" version = "0.3.0" @@ -2365,7 +2567,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ "bitflags 1.3.2", - "cfg-if", + "cfg-if 1.0.0", "libc", "memoffset 0.7.1", ] @@ -2377,7 +2579,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.5.0", - "cfg-if", + "cfg-if 1.0.0", "cfg_aliases", "libc", ] @@ -2404,7 +2606,7 @@ version = "4.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "827c5edfa80235ded4ab3fe8e9dc619b4f866ef16fe9b1c6b8a7f8692c0f2226" dependencies = [ - "log", + "log 0.4.21", "mac-notification-sys", "serde", "tauri-winrt-notification", @@ -2418,7 +2620,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" dependencies = [ "overload", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -2588,7 +2790,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ "bitflags 2.5.0", - "cfg-if", + "cfg-if 1.0.0", "foreign-types 0.3.2", "libc", "once_cell", @@ -2647,7 +2849,7 @@ version = "3.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" dependencies = [ - "log", + "log 0.4.21", "serde", "windows-sys 0.52.0", ] @@ -2721,7 +2923,7 @@ version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "libc", "redox_syscall", "smallvec", @@ -2734,6 +2936,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8835116a5c179084a830efb3adc117ab007512b535bc1a21c991d3b32a6b44dd" +[[package]] +name = "percent-encoding" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -2886,15 +3094,17 @@ dependencies = [ [[package]] name = "phoenix-code-ide" -version = "3.8.4" +version = "3.9.0" dependencies = [ + "bugsnag", "clipboard-files", + "dialog", "fix-path-env", "gtk", "lazy_static", "objc", "once_cell", - "percent-encoding", + "percent-encoding 2.3.1", "regex", "serde", "serde_json", @@ -2905,8 +3115,9 @@ dependencies = [ "tauri-plugin-single-instance", "tauri-plugin-window-state", "trash", + "webbrowser", "webkit2gtk", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -2949,7 +3160,7 @@ dependencies = [ "line-wrap", "quick-xml 0.31.0", "serde", - "time", + "time 0.3.34", ] [[package]] @@ -2973,10 +3184,10 @@ checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" dependencies = [ "autocfg", "bitflags 1.3.2", - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "libc", - "log", + "log 0.4.21", "pin-project-lite", "windows-sys 0.48.0", ] @@ -2987,7 +3198,7 @@ version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e0c976a60b2d7e99d6f229e414670a9b85d13ac305cc6d1e9c134de58c5aaaf6" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "concurrent-queue", "hermit-abi 0.3.9", "pin-project-lite", @@ -3034,7 +3245,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "version_check", + "version_check 0.9.4", ] [[package]] @@ -3045,7 +3256,7 @@ checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ "proc-macro2", "quote", - "version_check", + "version_check 0.9.4", ] [[package]] @@ -3255,15 +3466,15 @@ dependencies = [ "h2", "http", "http-body", - "hyper", + "hyper 0.14.28", "hyper-tls", "ipnet", "js-sys", - "log", - "mime", + "log 0.4.21", + "mime 0.3.17", "native-tls", "once_cell", - "percent-encoding", + "percent-encoding 2.3.1", "pin-project-lite", "rustls-pemfile", "serde", @@ -3275,7 +3486,7 @@ dependencies = [ "tokio-native-tls", "tokio-util", "tower-service", - "url", + "url 2.5.0", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", @@ -3296,7 +3507,7 @@ dependencies = [ "gtk-sys", "js-sys", "lazy_static", - "log", + "log 0.4.21", "objc", "objc-foundation", "objc_id", @@ -3307,6 +3518,17 @@ dependencies = [ "windows 0.37.0", ] +[[package]] +name = "rpassword" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d37473170aedbe66ffa3ad3726939ba677d83c646ad4fd99e5b4bc38712f45ec" +dependencies = [ + "kernel32-sys", + "libc", + "winapi 0.2.8", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -3370,6 +3592,12 @@ version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +[[package]] +name = "safemem" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" + [[package]] name = "same-file" version = "1.0.6" @@ -3433,7 +3661,7 @@ dependencies = [ "cssparser", "derive_more", "fxhash", - "log", + "log 0.4.21", "matches", "phf 0.8.0", "phf_codegen 0.8.0", @@ -3531,7 +3759,7 @@ dependencies = [ "serde_derive", "serde_json", "serde_with_macros", - "time", + "time 0.3.34", ] [[package]] @@ -3540,7 +3768,7 @@ version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6561dc161a9224638a31d876ccdfefbc1df91d3f3a8342eddb35f055d48c7655" dependencies = [ - "darling", + "darling 0.20.8", "proc-macro2", "quote", "syn 2.0.55", @@ -3584,7 +3812,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest", ] @@ -3595,7 +3823,7 @@ version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "cpufeatures", "digest", ] @@ -3616,7 +3844,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0d94659ad3c2137fef23ae75b03d5241d633f8acded53d672decfa0e6e0caef" dependencies = [ "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -3662,7 +3890,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -3799,6 +4027,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sys-info" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58283a48c9212afcade2069f8bbf7ded6a7bdbf4888d2defba72244c8e5f423c" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "sys-locale" version = "0.2.4" @@ -3884,10 +4122,10 @@ dependencies = [ "gtk", "image", "instant", - "jni", + "jni 0.20.0", "lazy_static", "libc", - "log", + "log 0.4.21", "ndk", "ndk-context", "ndk-sys", @@ -3967,7 +4205,7 @@ dependencies = [ "open", "os_info", "os_pipe", - "percent-encoding", + "percent-encoding 2.3.1", "rand 0.8.5", "raw-window-handle", "regex", @@ -3988,9 +4226,9 @@ dependencies = [ "tauri-utils", "tempfile", "thiserror", - "time", + "time 0.3.34", "tokio", - "url", + "url 2.5.0", "uuid", "webkit2gtk", "webview2-com", @@ -4038,7 +4276,7 @@ dependencies = [ "sha2", "tauri-utils", "thiserror", - "time", + "time 0.3.34", "uuid", "walkdir", ] @@ -4063,9 +4301,9 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4536f5f6602e8fdfaa7b3b185076c2a0704f8eb7015f4e58461eb483ec3ed1f8" dependencies = [ - "dirs", + "dirs 5.0.1", "interprocess", - "log", + "log 0.4.21", "objc2 0.4.1", "once_cell", "tauri-utils", @@ -4078,7 +4316,7 @@ name = "tauri-plugin-fs-extra" version = "0.0.0" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#184f4edbbcfed8f8c057a15e02318e0ddcaab132" dependencies = [ - "log", + "log 0.4.21", "serde", "serde_json", "tauri", @@ -4090,7 +4328,7 @@ name = "tauri-plugin-single-instance" version = "0.0.0" source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#184f4edbbcfed8f8c057a15e02318e0ddcaab132" dependencies = [ - "log", + "log 0.4.21", "serde", "serde_json", "tauri", @@ -4106,7 +4344,7 @@ source = "git+https://github.com/tauri-apps/plugins-workspace?branch=v1#184f4edb dependencies = [ "bincode", "bitflags 2.5.0", - "log", + "log 0.4.21", "serde", "serde_json", "tauri", @@ -4128,7 +4366,7 @@ dependencies = [ "serde_json", "tauri-utils", "thiserror", - "url", + "url 2.5.0", "uuid", "webview2-com", "windows 0.39.0", @@ -4143,7 +4381,7 @@ dependencies = [ "arboard", "cocoa", "gtk", - "percent-encoding", + "percent-encoding 2.3.1", "rand 0.8.5", "raw-window-handle", "tauri-runtime", @@ -4170,7 +4408,7 @@ dependencies = [ "infer", "json-patch", "kuchikiki", - "log", + "log 0.4.21", "memchr", "phf 0.11.2", "proc-macro2", @@ -4180,7 +4418,7 @@ dependencies = [ "serde_json", "serde_with", "thiserror", - "url", + "url 2.5.0", "walkdir", "windows-version", ] @@ -4211,7 +4449,7 @@ version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "fastrand 2.0.2", "rustix 0.38.32", "windows-sys 0.52.0", @@ -4275,7 +4513,7 @@ version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "once_cell", ] @@ -4290,6 +4528,17 @@ dependencies = [ "weezl", ] +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi 0.3.9", +] + [[package]] name = "time" version = "0.3.34" @@ -4494,7 +4743,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "log", + "log 0.4.21", "once_cell", "tracing-core", ] @@ -4517,6 +4766,12 @@ dependencies = [ "tracing-log", ] +[[package]] +name = "traitobject" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" + [[package]] name = "trash" version = "5.0.0" @@ -4525,7 +4780,7 @@ checksum = "8d8fbfb70b1fad5c0b788f9b2e1bf4d04e5ac6efa828f1ed9ee462c50ff9cf05" dependencies = [ "chrono", "libc", - "log", + "log 0.4.21", "objc2 0.5.2", "objc2-foundation", "once_cell", @@ -4563,6 +4818,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "typeable" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" + [[package]] name = "typenum" version = "1.17.0" @@ -4577,7 +4838,16 @@ checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ "memoffset 0.9.0", "tempfile", - "winapi", + "winapi 0.3.9", +] + +[[package]] +name = "unicase" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" +dependencies = [ + "version_check 0.1.5", ] [[package]] @@ -4607,6 +4877,17 @@ version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" +[[package]] +name = "url" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" +dependencies = [ + "idna 0.1.5", + "matches", + "percent-encoding 1.0.1", +] + [[package]] name = "url" version = "2.5.0" @@ -4614,8 +4895,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna", - "percent-encoding", + "idna 0.5.0", + "percent-encoding 2.3.1", "serde", ] @@ -4670,6 +4951,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "852e951cb7832cb45cb1169900d19760cfa39b82bc0ea9c0e5a14ae88411c98b" +[[package]] +name = "version_check" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" + [[package]] name = "version_check" version = "0.9.4" @@ -4747,6 +5034,12 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -4759,7 +5052,7 @@ version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "wasm-bindgen-macro", ] @@ -4770,7 +5063,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "log", + "log 0.4.21", "once_cell", "proc-macro2", "quote", @@ -4784,7 +5077,7 @@ version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "js-sys", "wasm-bindgen", "web-sys", @@ -4901,7 +5194,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" dependencies = [ "dlib", - "log", + "log 0.4.21", "pkg-config", ] @@ -4915,6 +5208,20 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webbrowser" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc6a3cffdb686fbb24d9fb8f03a213803277ed2300f11026a3afe1f108dc021b" +dependencies = [ + "jni 0.19.0", + "ndk-glue", + "url 2.5.0", + "web-sys", + "widestring", + "winapi 0.3.9", +] + [[package]] name = "webkit2gtk" version = "0.18.2" @@ -5006,6 +5313,18 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53a85b86a771b1c87058196170769dd264f66c0782acf1ae6cc51bfd64b39082" +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + +[[package]] +name = "winapi" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" + [[package]] name = "winapi" version = "0.3.9" @@ -5016,6 +5335,12 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] +[[package]] +name = "winapi-build" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" + [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -5028,7 +5353,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ - "winapi", + "winapi 0.3.9", ] [[package]] @@ -5490,7 +5815,7 @@ version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "windows-sys 0.48.0", ] @@ -5500,7 +5825,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", "windows-sys 0.48.0", ] @@ -5512,7 +5837,7 @@ checksum = "12b41773911497b18ca8553c3daaf8ec9fe9819caf93d451d3055f69de028adb" dependencies = [ "derive-new", "libc", - "log", + "log 0.4.21", "nix 0.28.0", "os_pipe", "tempfile", @@ -5544,7 +5869,7 @@ dependencies = [ "http", "kuchikiki", "libc", - "log", + "log 0.4.21", "objc", "objc_id", "once_cell", @@ -5554,7 +5879,7 @@ dependencies = [ "soup2", "tao", "thiserror", - "url", + "url 2.5.0", "webkit2gtk", "webkit2gtk-sys", "webview2-com", @@ -5618,7 +5943,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" dependencies = [ "libc", - "winapi", + "winapi 0.3.9", ] [[package]] @@ -5655,7 +5980,7 @@ dependencies = [ "static_assertions", "tracing", "uds_windows", - "winapi", + "winapi 0.3.9", "xdg-home", "zbus_macros", "zbus_names", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 9ae20361..956a9ce3 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -20,6 +20,9 @@ percent-encoding = "2.3.1" regex = "1.10.4" clipboard-files = "0.1.1" trash = "5" +dialog = "0.3.0" +bugsnag = "=0.2.1" +webbrowser = "0.7" serde = { version = "1.0.200", features = ["derive"] } tauri = { version = "1.6.2", features = [ "updater", "cli", "api-all", "devtools", "linux-protocol-headers"] } winapi = { version = "0.3.9", features = ["fileapi"] } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index cae22925..57d3d01e 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -3,6 +3,8 @@ all(not(debug_assertions), target_os = "windows"), windows_subsystem = "windows" )] use std::env; +use std::panic; +use bugsnag; use tauri::{Manager}; use std::path::PathBuf; @@ -25,6 +27,7 @@ extern crate webkit2gtk; extern crate objc; use clipboard_files; +use dialog::DialogBox; use regex::Regex; extern crate percent_encoding; @@ -266,6 +269,51 @@ fn get_mac_deep_link_requests() -> Vec { fn main() { let args: Vec = env::args().collect(); + + panic::set_hook(Box::new(|panic_info| { + let panic_message = panic_info.payload().downcast_ref::<&str>().unwrap_or(&"No specific error message available"); + eprintln!("Application panicked: {:?}", panic_message); + + let mut api = bugsnag::Bugsnag::new("4dc115247125339aa551f3b11a5bee6b", env!("CARGO_MANIFEST_DIR")); + let args: Vec = env::args().collect(); + let executable_name = if !args.is_empty() { + // Get the executable name from the full path + let path = &args[0]; + path.split(std::path::MAIN_SEPARATOR) + .last() + .unwrap_or("unknown_executable") + .to_string() + } else { + "unknown_executable".to_string() + }; + api.set_app_info(Some(env!("CARGO_PKG_VERSION")), + Some(&executable_name), + Some("rust")); + + // Construct the error message with the panic message included + let error_message = format!( + "The app crashed unexpectedly with error: \n\n'{}'. \n\nWould you like to send an anonymised error report to help us fix the problem?", + panic_message + ); + + let choice = dialog::Question::new(&error_message) + .title("Oops! Phoenix Code Crashed :(") + .show() + .expect("Could not display dialog box"); + + // take user to support page. maybe we will have some notifications pinned there if its a large scale outage + let support_url = "https://github.com/orgs/phcode-dev/discussions"; + if webbrowser::open(support_url).is_ok() { + println!("Opened support_url {} in the default browser.", support_url); + } else { + println!("Failed to open support_url {}.", support_url); + } + + if choice == dialog::Choice::Yes { + let _ = bugsnag::panic::handle(&api, panic_info, None); + } + })); + if args.contains(&"--runVerify".to_string()) { // Mainly used by linux installer to see if the app loaded successfully with all libs std::process::exit(0);