question

natesewell avatar image
natesewell asked

PlayFabHTTP.py not executing callback

I found an issue in the python SDK with PlayFabHTTP.DoPost() when executing a API method that has an empty response body, such as PlayFabServerAPI.SendAccountRecoveryEmail and PlayFabAdminAPI.ResetPassword, the callback never gets called on success.

The issue is that the response variable gets set to responseWrapper["data"] which in these cases is {} and later it checks for a value in response before executing the callback like so:

	elif response and callback:
	        try:
			# Notify the caller about an API Call success
			callback(response, None)

{} of course evaluates to False even though it is not None

the section causing the code is this

		else:
			# successful call to PlayFab
		        response = responseWrapper["data"]

which can be fixed by adding:

			if response == {}:
			response = {'success': 'success'}

or really anything that doesn't evaluate to false.

While, I can work around it for now, any chance of this getting fixed soon?

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

natesewell avatar image natesewell commented ·

oops, needed an extra tab before the final line of code

0 Likes 0 ·

1 Answer

·
JayZuo avatar image
JayZuo answered

Thanks for your feedback. I'll report this issue to SDK team. I can't guarantee when this issue will be fixed. Please keep an eye on GitHub page.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.