Fix timestamp-aware gateway resolution in snapshots and caches - #1230
Merged
Conversation
Signed-off-by: grandpig <grandpig@outlook.com>
Contributor
Author
|
@michaeldjeffrey Just following up on this in case it got buried. The main semantic change is to retain each gateway's inserted_at in both the snapshot and fallback cache, so resolution remains timestamp-aware regardless of cache order. The regression tests cover both before→after and after→before lookup orderings. Would appreciate a look when you have time. Thanks! |
bbalser
approved these changes
Aug 25, 2026
michaeldjeffrey
approved these changes
Aug 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.
Summary
Fix gateway resolution so the
inserted_atonboarding boundary is consistently enforced by both the snapshot and fallback-cache paths.Closes #1229
Problem
The per-gateway Trino queries evaluate gateway existence using:
but the in-memory snapshots do not retain inserted_at, so snapshot hits ignore the supplied query timestamp.
Fallback results are also cached only by public key even though the result depends on both public key and timestamp. This can cause a lookup for one report timestamp to incorrectly determine the result for another timestamp.
Changes
Tests
Added regression coverage for:
These cases are covered for both mobile_packet_verifier and mobile_verifier.