Addition of background prop to pokemon#312
Conversation
jfberry
left a comment
There was a problem hiding this comment.
looks good, subject only to data type issue in db
|
So testing contained C-Day? Thanks a lot, looks good |
|
I'm happy once someone has run this on db mode to prove it works (it looks ok, but...) |
|
I think the rest of the codebase uses LocationCard though. https://github.com/search?q=repo%3AUnownHash%2FGolbat+locationcard&type=code |
|
We should consider having consistency so change one to the other. AFAIC only ReactMap uses |
I agree +1 for consistency here. Have no opinion on terminology one way or the other, either works for me |
|
So we shake on |
|
@Mygod please confirm changes are ok as I don't know what I am doing. |
2c1f4c1 to
1b8b30e
Compare
|
@Petap0w to reuse the util method we just needed to change to int64, in JSON it doesn't even matter but One more comment, wihch would need to change I guess :) |
Mygod
left a comment
There was a problem hiding this comment.
[P0] Preserve null background when no location card — decoder/pokemon.go:1113-1116
With the new util helper we now call null.IntFrom(util.ExtractBackgroundFromDisplay(...)) (e.g. here and in setPokemonDisplay). When the proto has no LocationCard, ExtractBackgroundFromDisplay returns 0, and null.IntFrom(0) marks the column as valid. Previously we only populated the field when LocationCard != nil, so those records stayed NULL. After this change the majority of encounters will be persisted and webhooked with background = 0, which
is incorrect data and breaks the previous semantics consumers rely on to tell the difference between “no background” and “background id 0”. Please keep returning an invalid null.Int when the card is absent (e.g. only set Background if the card exists).
Mygod
left a comment
There was a problem hiding this comment.
Given that 0 represents no location card in GM, we should not have both null and 0 as options in the database creating confusion and unnecessarily complicated logic.
|
Actually I suppose GM can send both |
|
One thing that should be tested is whether location card is sent in wild not just encounter. Since we couldn't test it now, we could merge it first and fix it later if this turns out to be broken. |
We know the display object is only filled in a limited way in wild overworld contexts. Since we encounter anyway it seems pointless to try to populate from wild - there is only downside to this Some people do not process wild at all because it doesn’t especially help anything only slows down processing |
|
When I said wild, I was referring to |
All the GMO based Pokémon have a limited pokemondisplay population, so acting on any potential pre-setting of background here without evidence would be a mistake IMO. It’s far more likely this would end up removing any background capture from an encounter |
|
AFAIC the only thing that is not populated in |
|
From codex:
|
I'd be concerned if we used sqlite. But we don't. |
|
This file can be deleted, it has not been used since very early trials of in memory |
|
We should probably also have API support filtering by background too? |
|
Since gmo arrives much more frequently (and this proto doesn’t even get sent by some systems/modes) we deliberately only took missing data (name, desc, and latterly defenders) Probably the only bit in this PR that has value is being able to ignore the proto if gyms are turned off. Which I’m not sure anyone does |
I assume you wanted to comment on #315 ? |

Experimental but worked well all day for me here.
Will send "background" in pokemon webhook (either null or int value)