Jump to content
McKay Development

onFriendRelationshipChanged is fired even on error


Jack Nolddor
 Share

Recommended Posts

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 by Jack Nolddor
Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 v
4.21.0 would help a lot!

Edited by Jack Nolddor
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...