feat: weather consensus#326
Merged
Fabio1988 merged 2 commits intoUnownHash:mainfrom Jan 25, 2026
Merged
Conversation
Collaborator
|
What is the logic you have applied here? |
Contributor
Author
|
Collaborator
|
Claude suggests this comment to describe the algorithm for future readers, if it's accurate this might have helped me navigate the code. This seems like a sensible approach - I'll look at the code in more detail later // Weather Consensus Algorithm
//
// Pokemon Go performs A/B testing on weather conditions, meaning different accounts
// may observe different weather for the same S2 cell at the same time. This causes
// problems when multiple accounts report conflicting weather, leading to rapid
// flapping of stored weather values and incorrect IV calculations for Pokemon.
//
// This consensus mechanism aggregates weather observations from multiple accounts
// and only publishes updates when there is clear agreement:
//
// 1. VOTING: Each account gets one vote per cell. When an account reports weather,
// their vote is recorded. If they report again with a different condition,
// their previous vote is transferred to the new condition.
//
// 2. HOURLY RESET: Weather in PoGo changes on the hour, so consensus state resets
// when a new hour begins. Stale observations (from a previous hour) are ignored.
//
// 3. FIRST OBSERVATION: The first observation of each hour is always published
// immediately to ensure we have some weather data, even if only one account
// has reported.
//
// 4. SUBSEQUENT UPDATES: After the first publish, weather only changes if the
// leading condition's vote count STRICTLY exceeds the runner-up. This means:
// - Ties do not trigger updates (prevents flapping)
// - A clear majority is required to override the current weather
// - Single outlier accounts cannot flip the weather back and forth
//
// Example: If 3 accounts report "Cloudy" and 2 report "Sunny", we publish "Cloudy".
// If a 3rd account reports "Sunny" making it 3-3, we keep "Cloudy" (no strict majority).
// Only when "Sunny" reaches 4 votes would we switch. |
Collaborator
|
@jfberry this PR fixes as well the increased weather updates to DB. Testing this now 😀 |
Fabio1988
approved these changes
Jan 21, 2026
jfberry
reviewed
Jan 21, 2026
Fabio1988
approved these changes
Jan 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes #325. Needs testing.