discord-rpc-csharp icon indicating copy to clipboard operation
discord-rpc-csharp copied to clipboard

[BUG] Rich Presences don't do equality checks

Open JustArion opened this issue 9 months ago • 0 comments

Describe the bug Equality between presences are not considered

To Reproduce Steps to reproduce the behavior:

  1. Create a rich presence (A)
  2. Create another rich presence with the same values as A. (B)
  3. Test for equality between Rich Presence A and Rich Presence B
  4. Equality returns false

Expected behavior Equality is considered

Desktop (please complete the following information):

  • OS: Windows
  • Framework: .NET 9
  • Library Version: 1.2.1.24

Additional context

presence == _currentPresence // returns false
Newtonsoft.Json.JsonConvert.SerializeObject(presence) == Newtonsoft.Json.JsonConvert.SerializeObject(_currentPresence) // returns true

This is due to the default equality check being a reference basedcheck instead of a value based check.

JustArion avatar Feb 14 '25 12:02 JustArion