feat: initial maxbattle tracking in poracle#929
feat: initial maxbattle tracking in poracle#929ReuschelCGN wants to merge 32 commits intoKartulUdus:developfrom
Conversation
| } | ||
| if (!hook.message.poracleTest) { | ||
| fastify.webhooks.info(`max_battle ${JSON.stringify(hook.message)}`) | ||
| const cacheKey = `${hook.message.id}${hook.message.battle_end}${hook.message.battle_pokemon_id}` |
There was a problem hiding this comment.
The cache will expire well ahead of the max battle most probably, so this may not provide any value whatsoever.
What causes golbat to resend a station webhook and do we care that this will generate a new alert?
There was a problem hiding this comment.
hook.message.id -> Station ID
hook.message.battle_end -> is eqal to end_time in golbat DB
hook.message.battle_pokemon_id -> if this change we get a new alert on same station
Why the cache should expire in normal use ahead of the max battle end?
But on Maxmondays or Events, it should gen. a new alert.
There was a problem hiding this comment.
Jabes meant that you put an element into cache, but the cache itself lasts for x minutes?! Maybe an hour? So cache lookup will almost never happen
Golbat is not sending any duplicate hooks, it only sends if there something changes, like battle end, or Pokémon etc.
There was a problem hiding this comment.
Yes, the cache lasts an hour (I think). And the max battle has a duration much longer than that, so updates within the period will not be eliminated by the cache
There was a problem hiding this comment.
ok so the cache could look like that:
const cacheKey = ${hook.message.id}${hook.message.battle_pokemon_id}``
There was a problem hiding this comment.
Rephrasing my question - are there any duplicate webhook messages that you are trying to avoid passing into the alerting engine?
Maxbattles have rotating moves and there are stationed mons which change, so i wanted to be sure, not to gen unnecessary alterts. But maybe im wrong with my thought.
There was a problem hiding this comment.
Max Monday would be such a case... For one hour there is a certain mon deployed... After that hour it changes back to the old one.... Golbat might send another hook
But the old mon can be already available for days, a one hour cache won't belp on that duplicate
There was a problem hiding this comment.
Can we increase the cache for max battles to 2h? So we would safely not send a duplicate webhook on the 7PM change? :)
There was a problem hiding this comment.
Line 49 in 1ab5309
looks like its gen. 90min cache
There was a problem hiding this comment.
Hmm... As the first webhook could be sent the day before, we might still send another hook at 7PM... If I think about it, that's not that bad I guess
Do you have some notification examples for max monday or e.g. this event with Toxtricity?! :)
|
UnownHash/Golbat#312 merged |
|
Added to Poracle NG |
init PR for maxbattle tracking in poracle
(needs Golbat: https://github.com/UnownHash/Golbat/tree/stations-wh)
maxbattle tileserver templates, basic dts.json and poracle testdata are included
!poracle-test max-battle gmax!poracle-test max-battle level3!poracle-test max-battle level1IMPORTANT:
this PR needs testing and feedback specially for the icons (i use the uicons.js from turtlesocks in poracle) and telegram
Maxbattle Tracking
!maxbattle d800 clean -> reports all "MaxbattleBossName" Maxbattles within 800 meters (d=distance in meters) of your set location and deletes the report after expiration
!maxbattle d500 gmax clean -> reports all "MaxbattleBossName" gmax battles within 500 meters (d=distance in meters) of your set location and deletes the report after expiration
!maxbattle level -> reports all Maxbattles with level "MaxbattleLevel" (possible Level: 1-8 where Level 6-8 are gmax Maxbattles)
!maxbattle remove -> removes "MaxbattleBossName" from the Maxbattle tracking
#available variables are: , level, move, gmax (only Gmax Battles), distance, clean