Skip to content
This repository has been archived by the owner on Dec 15, 2018. It is now read-only.

set_favorite_pokemon API call fails if passed any pokemon_id greater than 9223372036854775807 #195

Open
snicker opened this issue Mar 28, 2017 · 1 comment

Comments

@snicker
Copy link

snicker commented Mar 28, 2017

I was adding a method to my organizer tool to allow me to favorite/unfavorite Pokemon and noticed that it would work intermittently, occasionally giving this error:

WARNING:pgoapi.rpc_api:Argument pokemon_id with value 12784024686362352118 unknown inside set_favorite_pokemon_message (Exception: 'int' object has no attribute 'append')

couldn't figure it out at first, but it appears that anything greater than the max positive value for a signed 64bit integer causes this failure. However, Pokemon IDs seem to be unsigned 64 bit ints. I tested this and I was able to use set_favorite_pokemon on pokemon_ids less than 9223372036854775807, anything greater than this failed.

I don't know if this has to do with Protos or pgoapi. I tried manipulating the types in the set_favorite_pokemon_message to match those in release_pokemon_message (as this API call works with the uint64 pokemon_id) to no result, but the coincidence leads me to believe it's a typing error somewhere along the line.

@snicker
Copy link
Author

snicker commented Apr 30, 2017

a workaround shared by @petrklic in Discord:

set_favorite_pokemon, it seems this workaround works:
set_favorite_pokemon(pokemon_id=p_id if p_id < 2**63 else p_id-2**64, is_favorite=favorite)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants