Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • Bugs /
avatar image
Question by maximelaffaire · Dec 23, 2016 at 03:58 PM · CloudScriptFriends

RemoveFriend is not always working

Hi,

I have two accounts (let's call them A and B).

A is friend with B and B is friend with A. I know that because when I call GetFriendList, both appears in each other friend list.

When I try to remove that friendship in my cloudscript, playfab throw an error without any data inside.

So far I'm sure that the problem doesn't come from the application itself, since it's working with other friendship and/or other accounts (for example I can remove the friendship between A and another account C, or between B and C, or between C and another account D).

I don't think it's coming from my cloudscript neither since I executed it from the dashboard and have the same result when I try to remove the friendship between A and B (error) but a success when it's about A and C, B and C ...

I believe A and B are friends for a "long" time (probably a month or two).

Here is my function and its result, thank you for reading

handlers.removeFriend = function(args)
{
	var friendId = args.FriendPlayFabId;
	var succeed = true;
	try {
		server.RemoveFriend({PlayFabId : currentPlayerId, FriendPlayFabId : friendId});
	}
	catch (err) {
		succeed = false;
	}

	try {
		server.RemoveFriend({PlayFabId : friendId, FriendPlayFabId : currentPlayerId});
	}
	catch (err) {
		succeed = false;
	}
	return {hasBeenRemoved:succeed};
};


and the result I got when I execute it from the dashboard :

{
    "FunctionResult": {
        "hasBeenRemoved": false
    },
    "Logs": [
        {
            "Level": "Error",
            "Message": "PlayFab API request error",
            "Data": [
                [
                    []
                ],
                [
                    [
                        [
                            []
                        ],
                        [
                            []
                        ]
                    ]
                ],
                [
                    []
                ],
                [
                    [
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ]
                    ]
                ]
            ]
        },
        {
            "Level": "Error",
            "Message": "PlayFab API request error",
            "Data": [
                [
                    []
                ],
                [
                    [
                        [
                            []
                        ],
                        [
                            []
                        ]
                    ]
                ],
                [
                    []
                ],
                [
                    [
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ],
                        [
                            []
                        ]
                    ]
                ]
            ]
        }
    ],
    "ExecutionTimeSeconds": 0.1521986,
    "MemoryConsumedBytes": 121544,
    "APIRequestsIssued": 2,
    "HttpRequestsIssued": 0,
    "Error": null
}

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image

Answer by Brendan · Dec 23, 2016 at 06:54 PM

What are the specific values you're passing into the Cloud Script, and what Title ID is this for? Just so you know, there's no difference between calling a Server API method via Cloud Script or from Postman, etc., so you can also see the results by trying that tool. The output looks like an issue with the way the Game Manager is returning the results, so we'll have a look at that.

Comment

People who like this

0 Show 1 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image maximelaffaire · Jan 02, 2017 at 09:38 AM 0
Share

Hi,

The title ID where the bug appeared is 51A9 (alpha version), but I believe it happened one time on the dev version 8FCB.

If I remember well the currentPlayerId was 9F34D34214BDD6AC and the argument friendId was 8F0747F648EA4119.

Sorry it took a long time to reply !

avatar image

Answer by Brendan · Jan 03, 2017 at 03:49 AM

I see the issue - whenever a Server API call is failing from within Cloud Script, there is an error log automatically being generated. It seems that the Game Manager is not able to show that error output correctly at the moment, so I've opened a bug for that to get fixed as soon as possible.

Right now, you can see your error output by adding this line to your catch clauses:

log.info(JSON.stringify(err));
Comment

People who like this

0 Show 6 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image maximelaffaire · Jan 03, 2017 at 09:54 AM 0
Share

Thanks @Brendan, I'm going to test that. However, I can't reproduce the bug at will and somehow removing each account (A and B from my original post) from each friend list worked yesterday, did your team fixed anything ?

avatar image Brendan ♦♦ maximelaffaire · Jan 03, 2017 at 06:45 PM 0
Share

No, we haven't changed anything. But it's actually easy to reproduce - just try removing a friend twice. The first time works, while the second time returns an error (which shows the issue)

avatar image maximelaffaire Brendan ♦♦ · Jan 04, 2017 at 08:29 AM 0
Share

Well ithe second call is throwing an error indeed, but it seems normal to me since the first call worked. My first problem was that 2 account were in each other friends list (which I get with Client/GetFriendsList) and it was impossible to unfriend them

Show more comments

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Server API - Possible Bug: You only get Friend tags with the GetFriendList call if the parameter ProfileConstraints is null 1 Answer

    GetFriendsList critical error 3 Answers

    Add Friend in CloudScript Issues 1 Answer

    Cant remove friend 2 Answers

    GetFriendsList not returning FriendTags. 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges