Jack Nolddor Posted October 28, 2021 Report Posted October 28, 2021 (edited) How to reproduce: Try to addFriend() on an steamid already present at our friendlist Expected Behavior: SteamUser#addFriend() returned promise should fail with the following: EResult=14, Message=DuplicateName No event is thrown as our friend relationships haven't changed. Actual Behavior: SteamUser#.addFriend() returned promise fails with the following: EResult=14, Message=DuplicateName SteamUser emits an 'onFriendRelationshipChanged' event even though if the above call fails. Am i doing something wrong or is it a bug? Edited October 28, 2021 by Jack Nolddor Quote
Dr. McKay Posted October 29, 2021 Report Posted October 29, 2021 It's not really a bug, per se. friendRelationship is emitted when Steam sends down a message that a relationship changed. I guess Steam assumes that your local data is out of date if you try to add someone who's already your friend, so you get the friendRelationship notification to make sure that your client is aware they're already your friend. Nonetheless, I'll suppress friendRelationship and groupRelationship events for updates to our already-known relationship in 4.21.0. Quote
Jack Nolddor Posted October 30, 2021 Author Report Posted October 30, 2021 (edited) 21 hours ago, Dr. McKay said: It's not really a bug, per se. friendRelationship is emitted when Steam sends down a message that a relationship changed. I guess Steam assumes that your local data is out of date if you try to add someone who's already your friend, so you get the friendRelationship notification to make sure that your client is aware they're already your friend. Nonetheless, I'll suppress friendRelationship and groupRelationship events for updates to our already-known relationship in 4.21.0. That's what i'm doing right now, instead of calling SteamUser#addFriend() directly i'm checking if the given steamid is already on myFriends with a EFriendRelationship.Friend to just don't call SteamUser#addFriend(). Probably the event is also thrown when EFriendRelationship.locked but haven't tested myself. Thanks for this addition to v4.21.0 would help a lot! Edited October 30, 2021 by Jack Nolddor Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.