Repository navigation
test: cover price snapshot writer skipping unchanged prices - #1209
Merged
Chucks1093 merged 1 commit intoOct 24, 2026
Conversation
…yerorg#763) Add writePriceSnapshot, a price snapshot writer that compares the incoming price with the most recent CreatorPriceHistory row and skips the write when the price is unchanged. The first snapshot for a creator is always written. The per-trade indexer path (upsertPriceSnapshot) is left as is: it records every trade, including unchanged prices, which the full-window trade TWAP depends on (accesslayerorg#880). Unit tests cover the accesslayerorg#763 acceptance criteria: - unchanged price skips the write - changed price triggers the write - first snapshot is always written Closes accesslayerorg#763
flare-999
force-pushed
the
fix/issue-763-add-unit-tests-for-the-price-snapshot-writer-r2
branch
from
October 23, 2026 20:42
53b037d to
5112479
Compare
Member
✅ PR Ready for ReviewDue to a recent malware incident affecting our repositories, all PRs are required to pass automated security checks before being reviewed for merging. This PR has passed all automated checks:
Next step: Please share this PR link in our Telegram group so a maintainer can review and merge it: https://t.me/c/accesslayerorg/8514 |
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.
Overview
This PR adds unit tests for the price snapshot writer's skip-on-unchanged behavior. The tests verify that a snapshot write is skipped when the new price equals the most recent stored snapshot for a creator, that a changed price still triggers a write, and that the first snapshot for a creator is always written since there is no previous snapshot to compare against.
Related Issue
Changes
🧪 Price Snapshot Writer Tests
src/jobs/price-history-cleanup.job.test.tsVerification Results
Closes #763