Skip to content

GameSDK RelationshipManager.OnRefresh Issue: Returning 0 Relations #6446

Closed
@andreslunchbox

Description

@andreslunchbox

Description

Users are encountering a sudden issue with Discord's GameSDK, where the relationshipManager.OnRefresh callback is consistently returning 0 relations. This problem impacts developers who use this feature to create friends lists, affecting their application functionality and user experience.

Steps to Reproduce

Use the exact same code provided in Discord's documentation to generate friends lists:

var discord = new Discord.Discord(clientId, Discord.CreateFlags.Default);
var relationshipManager = discord.GetRelationshipManager();

relationshipManager.OnRefresh += () =>
{
  relationshipManager.Filter((relationship) =>
  {
    return relationship.Type == Discord.RelationshipType.Friend;
  });

  Console.WriteLine("relationships updated: {0}", relationshipManager.Count());

  for (var i = 0; i < relationshipManager.Count(); i++)
  {
      var r = relationshipManager.GetAt((uint)i);
      Console.WriteLine("relationships: {0} {1}", r.Type, r.User.Username);
  }
}

Expected Behavior

The result should be a number higher than 0 as the accounts running that code are confirmed to have relationships.

Current Behavior

The on refresh call returns 0 results, something that is worth noting is that the onRelationshipUpdate callback works fine so this must be an issue with the onRefresh callback only not the entire relationship manager.

The code below works fine:

relationshipManager.OnRelationshipUpdate += (ref Discord.Relationship relationship) =>
{
  Console.WriteLine("User is {0}", relationship.User.Username);
}

Screenshots/Videos

No response

Client and System Information

Discord

Stable 230264 (c282a55) Host 1.0.9018 x86 (37496) Windows 10 64-Bit (10.0.22621)

System

Device name xps
Processor 12th Gen Intel(R) Core(TM) i7-12700H 2.30 GHz
Installed RAM 32.0 GB (31.7 GB usable)
System type 64-bit operating system, x64-based processor
Edition Windows 11 Home
Version 22H2
OS build 22621.2283
Experience Windows Feature Experience Pack 1000.22662.1000.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions