CollapseLauncher / Collapse

An Advanced Launcher for miHoYo/HoYoverse Games
MIT License
1.4k stars 64 forks source link

[Bug]: Discord Rich Presence option, when turned off does not persist after changing games in the launcher. #304

Closed BreadtheRipper closed 11 months ago

BreadtheRipper commented 1 year ago

Affected Version

1.72.5 Preview

Bug Behavior

Disabling the "Show Discord Presence" option in settings works, until the game is changed. Note that in my recording of the issue, there is a bit of a delay in Discord updating the display of Rich Presence for Collapse, but that is seemingly a discord issue itself, and is unrelated to the issue being reported. A screen record has been attached which shows both of these issues synchronously.

Expected Behavior

Discord Rich Presence is expected to not display any information for Collapse, even after the game is changed.

Steps to reproduce

  1. Disable "Show Discord Presence" in settings. Open discord and note that nothing concerning Collapse shows up on your profile; it works
  2. Change the game to a different one (eg. From Honkai Impact 3rd to Genshin Impact)
  3. Check discord now, and note that Collapse Rich Presence is now present on your profile
  4. Open settings in Collapse and confirm that the toggle for "Show Discord Presence" is still off
  5. Toggle it on, then off, and then note in Discord that the Presence is once again correctly disabled.
  6. Repeat from Step 1, this can be done indefinitely

Related Issues

No response

Screenshot(s)

https://github.com/CollapseLauncher/Collapse/assets/37238148/0f8bc1a5-55ce-4256-ab3c-c2d06346d864

Additional Information

DxDiag.txt log-2023-10-27-pre1.72.5-id1.log

bagusnl commented 1 year ago

Seems like Discord RPC module did not properly get disposed when disabled. Can be observed if you use arRPC and look at the console output and see bunch of socket closed "false" as seen here: image Will investigate more

Update: After looking a bit more, it seems that Discord can randomly take quite a long time to dispose the RPC status. This caused the RPC to still open for quite a while after being disabled. Will keep investigating

bagusnl commented 1 year ago

Fixed as of commit https://github.com/CollapseLauncher/Collapse/commit/aac1e0f059a122520881a9744d2c9631ea56d249

https://github.com/CollapseLauncher/Collapse/assets/28079733/37387fa9-6e4c-4ffd-a2f0-673ef5216332

Thank you for reporting this issue! The fix will be submitted in next preview update. Though since we are currently in progress for .NET8 migration, this fix might take a while to appear on regular release.

BreadtheRipper commented 1 year ago

Hey! As of preview 1.72.6, this issue seems partially fixed! It definitely updates the game/activity in more real time than before, however the issue of the Discord rich presence showing up on my profile after I've turned it off then switched games is still there Not sure if that specific issue was fixed, but just wanted to mention it in case!

bagusnl commented 1 year ago

Will reinvestigate this issue once I have a bit more free time

bagusnl commented 12 months ago

This should be completely fixed by both https://github.com/CollapseLauncher/Collapse/commit/eb816481a985a55a46b8e9c819b5b8e8cd105fd4 and https://github.com/CollapseLauncher/Collapse/commit/a5a061b17f72706b04061a5deaaf7527879723b6 Though we will not close this issue until next preview is released and it can be fully confirmed that the bug is now fixed

BreadtheRipper commented 12 months ago

Thank you for your quick work!

bagusnl commented 11 months ago

Should be fixed in 1.72.7 preview