-
Notifications
You must be signed in to change notification settings - Fork 1
Fix IsNew logic #32
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
Fix IsNew logic #32
Conversation
WalkthroughThis pull request introduces modifications to both a JSON commit history file and the snapshot evaluation logic. The changes in the commit history file update various identifier properties and add a new snapshots array to a commit, reflecting a more detailed merged history. Meanwhile, the Changes
Sequence Diagram(s)sequenceDiagram
participant SW as SnapshotWorker
participant PS as _pendingSnapshots
participant RS as _rootSnapshots
participant S as Snapshot Input
S->>SW: Call IsNew(snapshot)
SW->>PS: Lookup snapshot by entity ID
alt Pending Snapshot Found
PS-->>SW: Return pending snapshot
SW->>SW: Compare pending snapshot ID with incoming snapshot
SW-->>S: Return true if IDs match
else No Pending Snapshot
SW->>RS: Lookup snapshot by entity ID
RS-->>SW: Return root snapshot
SW->>SW: Compare root snapshot ID with incoming snapshot
SW-->>S: Return true if IDs match
end
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🔇 Additional comments (5)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
hahn-kev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch. I think we need a way to test the SnapshotWorker directly as it's far too complicated to test indirectly which is why we've got so many issues here. Either that or we break it up to make it more testable.
As for the order, I actually think we should check both dictionaries for snapshots, maybe it won't matter based on our current patterns. Though I guess if you plan to remove it then it doesn't matter.
I started working on deferring intermediate snapshot selection and ran into this bug. Somehow we both 😱 overlooked that the boolean logic was backwards and that it's important to check pending before root.
I expect to delete the
IsNewcheck entirely, but this PR also corrects the snapshot data of a test, so I'd like to merge it first.Summary by CodeRabbit
New Features
Refactor