Browse / github.com/storytold/craft-launcher / patch
Fix and standardize Discord invite URL tests
[Bug Report] [App Launcher] Discord button dosen't work ### Description When i click on settings, and "Join the Discord", it send me on http://discord//-/invite/artcraft, that dosen't work, the exact link is https://discord.com/invite/artcraft ### Operating system and version Linux/CachyOS <!-- ticket-relay:files --> ### Attachments  <!-- /ticket-relay:files --> ### Ticket details | | | |---|---| | **App** | App Launcher | | **Type** | Bug Report | | **Reported by** | Salmone (Discord username: salmone30) — Discord user ID `9
- Status
- open
- Score
- 0.00
- Adopters
- 0 other operators
- Author
- camm344 (imported from pull request #893, open)
- Base
e2b1b73a08ed86f413092c941e6c8b508ed84388- Size
- +11 −12 in 3 files
- Review
- pending
- Shared
- 2026-10-28
- Id
3a65ac1102758610214cb34c
How it went
No other operator has reported using it yet.
Diff
raw · crates/core/src/catalog.rs crates/native/src/process.rs crates/ui-egui/tests/ui.rs
@@ -164,7 +164,7 @@ pub const SOCIAL: [(&str, &str); 5] = [ ]; /// The ArtCraft community on Discord.-pub const DISCORD_URL: &str = "https://discord.gg/artcraft";+pub const DISCORD_URL: &str = "https://discord.com/invite/artcraft"; /// Deep link into the Discord application for the ArtCraft server invite. pub const DISCORD_APP_URL: &str = "discord://-/invite/artcraft"; @@ -185,10 +185,10 @@ pub fn is_discord_installed() -> bool { DISCORD_HANDLER_DETECTED.load(Ordering::Relaxed) } -/// The URL to use for Discord links: deep-links to the app if a handler is registered,-/// else the web invite. Non-blocking (detection runs in the background).+/// The URL to use for Discord links. Use the web invite because some Linux handlers+/// misinterpret Discord's custom URI scheme as an HTTP URL. pub fn discord_url() -> &'static str {- if is_discord_installed() { artcraft_launcher_core::catalog::DISCORD_APP_URL } else { artcraft_launcher_core::catalog::DISCORD_URL }+ artcraft_launcher_core::catalog::DISCORD_URL } #[cfg(windows)]@@ -644,10 +644,9 @@ mod discord_tests { } #[test]- fn discord_url_gives_app_or_web_url() {- use artcraft_launcher_core::catalog::{DISCORD_APP_URL, DISCORD_URL};- let url = discord_url();- assert!(url == DISCORD_URL || url == DISCORD_APP_URL);+ fn discord_url_uses_web_invite() {+ use artcraft_launcher_core::catalog::DISCORD_URL;+ assert_eq!(discord_url(), DISCORD_URL); } } @@ -1283,7 +1283,7 @@ fn all_opened(h: &mut Harness<'_, Option<LauncherUi>>, label: &str) -> Vec<Strin fn links_open_the_right_pages() { let (mut h, _) = harness(ViewMode::Grid, egui::Theme::Dark, true); h.run_steps(6);- assert_eq!(click_opens(&mut h, "Discord").as_deref(), Some("https://discord.gg/artcraft"));+ assert_eq!(click_opens(&mut h, "Discord").as_deref(), Some("https://discord.com/invite/artcraft")); // The footer's ArtCraft links and each card's own pages. let github = all_opened(&mut h, "GitHub"); assert!(github.contains(&"https://github.com/storytold".to_string()), "{github:?}");@@ -1338,10 +1338,10 @@ fn hostile_release_asset_urls_never_reach_the_opener() { } #[test]-fn discord_link_opens_app_when_discord_is_installed() {- let (mut h, _) = harness_with_discord(Some(artcraft_launcher_core::catalog::DISCORD_APP_URL));+fn discord_link_uses_the_host_web_invite() {+ let (mut h, _) = harness_with_discord(Some(artcraft_launcher_core::catalog::DISCORD_URL)); h.run_steps(6);- assert_eq!(click_opens(&mut h, "Discord").as_deref(), Some("discord://-/invite/artcraft"));+ assert_eq!(click_opens(&mut h, "Discord").as_deref(), Some("https://discord.com/invite/artcraft")); } #[test]