-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mobile Config filter Boosted Hexes #801
Merged
michaeldjeffrey
merged 8 commits into
mj/hip-109-boost-by-device-type
from
mj/mobile-config-filter-boosted-hexes
May 8, 2024
Merged
Mobile Config filter Boosted Hexes #801
michaeldjeffrey
merged 8 commits into
mj/hip-109-boost-by-device-type
from
mj/mobile-config-filter-boosted-hexes
May 8, 2024
Conversation
This file contains 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
michaeldjeffrey
force-pushed
the
mj/hip-109-boost-by-device-type
branch
3 times, most recently
from
May 6, 2024 18:22
cd41f6c
to
cbf911e
Compare
michaeldjeffrey
force-pushed
the
mj/mobile-config-filter-boosted-hexes
branch
from
May 6, 2024 18:39
703e94a
to
90480d1
Compare
michaeldjeffrey
force-pushed
the
mj/hip-109-boost-by-device-type
branch
from
May 6, 2024 21:10
cbf911e
to
af92443
Compare
andymck
reviewed
May 7, 2024
michaeldjeffrey
force-pushed
the
mj/mobile-config-filter-boosted-hexes
branch
from
May 7, 2024 18:11
90480d1
to
62c89f5
Compare
Making the internal member hexes private will make it easier to change the implementation when device type is introduced.
also makes it easier to add new tests
Thanks for the query help Brian! By precomputing the end timestamp of a boosted hex, we can not have to stream all the hexes out of the db just to throw them away.
- remove unused imports - remove old refactor return types
If the expired check had been made a global check, the ability to use BoostedHexes for modified hexes would have broken at runtime. The attempt here is to make very explicit during testing how to meet the same contract as the database queries for boosted hexes. I think there are still some cracks, but we can narrow in on those as we find them. For now, I think naming test constructor functions is a good start.
michaeldjeffrey
force-pushed
the
mj/mobile-config-filter-boosted-hexes
branch
from
May 7, 2024 21:03
62c89f5
to
66b36d8
Compare
michaeldjeffrey
added a commit
that referenced
this pull request
Sep 6, 2024
* Refactor to use BoostedHexes methods Making the internal member hexes private will make it easier to change the implementation when device type is introduced. * Add device type to boosted hex info * refactor metadata_db tests to make test clearer also makes it easier to add new tests * remove expired boosted hexes when streaming from db * ensure no tests are written with expired boosted hexes * optimize by computing end_ts in db query Thanks for the query help Brian! By precomputing the end timestamp of a boosted hex, we can not have to stream all the hexes out of the db just to throw them away. * fixup after rebase - remove unused imports - remove old refactor return types * make boosted hex test function more explicit If the expired check had been made a global check, the ability to use BoostedHexes for modified hexes would have broken at runtime. The attempt here is to make very explicit during testing how to meet the same contract as the database queries for boosted hexes. I think there are still some cracks, but we can narrow in on those as we find them. For now, I think naming test constructor functions is a good start.
michaeldjeffrey
added a commit
that referenced
this pull request
Sep 6, 2024
* Refactor to use BoostedHexes methods Making the internal member hexes private will make it easier to change the implementation when device type is introduced. * Add device type to boosted hex info * refactor metadata_db tests to make test clearer also makes it easier to add new tests * remove expired boosted hexes when streaming from db * ensure no tests are written with expired boosted hexes * optimize by computing end_ts in db query Thanks for the query help Brian! By precomputing the end timestamp of a boosted hex, we can not have to stream all the hexes out of the db just to throw them away. * fixup after rebase - remove unused imports - remove old refactor return types * make boosted hex test function more explicit If the expired check had been made a global check, the ability to use BoostedHexes for modified hexes would have broken at runtime. The attempt here is to make very explicit during testing how to meet the same contract as the database queries for boosted hexes. I think there are still some cracks, but we can narrow in on those as we find them. For now, I think naming test constructor functions is a good start.
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.
This PR builds on top of #798.
Expired Boosted Hexes are filtered when streaming from the DB so Clients don't have to know to ignore Boosted Hexes that should no longer apply.
Because mobile-config will no longer return expired boosted hexes, the
BoostedHexes
struct will also enforce that limitation in tests where it is used directly.