Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game SDK ClearActivity fails with error code 5 (InvalidPayload) #6612

Open
x157 opened this issue Jan 9, 2024 · 7 comments
Open

Game SDK ClearActivity fails with error code 5 (InvalidPayload) #6612

x157 opened this issue Jan 9, 2024 · 7 comments
Labels
bug gamesdk synced Synced to internal tracker

Comments

@x157
Copy link

x157 commented Jan 9, 2024

Description

As of SDK 3.2.1, after setting an Activity, later trying to ClearActivity results in the following internal Discord error:

ResponseError { code: InvalidPayload, message: "child \"activity\" fails because [child \"supported_platforms\" fails because [\"supported_platforms\" must contain at least 1 items]]" }

This error was previously reported in Feb 2021 in the now-retired gamesdk-and-dispatch repository.

Steps to Reproduce

Update some activity:

discord::Activity Activity {};
// Set up Activity settings here (omitted for brevity, this part is not the problem)
DiscordCore().ActivityManager().UpdateActivity(Activity, [] (discord::Result Result) {});

Then try to ClearActivity:

DiscordCore().ActivityManager().ClearActivity([] (discord::Result Result) {});

Expected Behavior

I expect that ClearActivity() will actually clear the activity without generating an error.

Current Behavior

  • The activity does not get cleared
  • An internal Discord error message is issued complaining that supported_platforms is not set

Screenshots/Videos

No response

Client and System Information

Win64 UE 5.3 DiscordGameSample project with Discord GameSDK 3.2.1

@x157 x157 added the bug label Jan 9, 2024
x157 added a commit to XistGG/DiscordGameSample that referenced this issue Jan 9, 2024
@x157
Copy link
Author

x157 commented Jan 9, 2024

For now I #ifdefd out the ClearActivity code since it doesn't do anything other than generate an error.

You can see the exact code to repro here:

https://github.com/XistGG/DiscordGameSample/blob/main/Source/DiscordGameSample/CustomDiscordGameSubsystem.cpp

@lmle lmle changed the title SDK ClearActivity fails with error code 5 (InvalidPayload) Game SDK ClearActivity fails with error code 5 (InvalidPayload) Jan 9, 2024
@lmle lmle added the gamesdk label Jan 9, 2024
@ykogan-discord ykogan-discord added the synced Synced to internal tracker label Jan 18, 2024
@ProbablePrime
Copy link

This issue is periodically mentioned in the Discord developer discord and each time no one gets any assistance with it. If you search the Discord for "ClearActivity" you'll see tons of results.

For now I'm getting around this by sending up a blanked out activity when I want to clear it, but it would be really good if this issue could get some attention. Even a short sentence explaining the situation would help.

@ProbablePrime

This comment was marked as outdated.

@advaith1
Copy link
Member

advaith1 commented May 9, 2024

Pretty sure that comment is referring to version 3.2.1, which seems to be the one people are having this issue on.

@ProbablePrime
Copy link

You're right, thank you!

I had multiple editor windows open and was confused.

@ProbablePrime
Copy link

ProbablePrime commented May 9, 2024

I played around in: https://github.com/ProbablePrime/DiscordRichPresenceClear. This now is a Console App for .NET 8 that shows the issue and therefore constitutes a minimum reproduction case.

I thought setting activity.SupportedPlatforms = (uint)ActivitySupportedPlatformFlags.Desktop;, might help as that's the item from the error message. But alas no, it will still fail.

@ProbablePrime
Copy link

I noticed that there was a new SDK for embeded(browser) targets, this SDK supports Discord Activities(The games that you can play in discord).

From there I went to the source code of the Embeded SDK, where i found the Set Activity Command

The Set activity command lead me to the RPC documentation.

Where I also don't see a "clear activity" RPC call.

There's also some new functionality in the RPC Calls that is not exposed in the Game SDK.

So with even the new SDK not having a clear activity call, the plot thickens I guess.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug gamesdk synced Synced to internal tracker
Projects
None yet
Development

No branches or pull requests

5 participants