Repository navigation
import: stage only the target night - #791
Conversation
Reviewer's GuideImplementationFor single-date imports, stage only the target night while preserving the full walk for multi-date imports.
TestsVerify that importing one requested date segments only one night, not the buffered prior evening.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨No code suggestions found for the PR. |
User description
import derive called calendarDays(sub) with no target, so every imported day also re-staged the prior evening it carries as context and then threw that result away. that's two nights of sleep staging per day, on the ui isolate.
when deriveImportedDays gets one date (every NoopIngest call) it now passes targetDay + skipUnusedDays like the live path does. multi-date calls keep the full walk. test checks only one night gets segmented.
Summary by Sourcery
Optimize single-date imports to avoid unnecessary staging of contextual evenings.
Bug Fixes:
Tests:
PR Type
Bug fix, Tests
Description
Single-date imports now stage only the target night, not the buffered prior evening
Eliminates redundant sleep staging (two nights per import day) on the UI isolate
Test added verifying exactly one night is segmented for a single-date import
Diagram Walkthrough
File Walkthrough
derivation_engine.dart
Pass targetDay to calendarDays for single-date importslib/compute/derivation_engine.dart
dates.length == 1, extractstargetand passestargetDay+skipUnusedDays: truetocalendarDays()isolate for every single-date import
derive_day_window_test.dart
Test that single-date import segments exactly one nighttest/derive_day_window_test.dart
'an import stages only the requested date, not the bufferedevening'date
deriveImportedDaysreturns 1 anddebugSegmentedDayCountequals1
Summary by CodeRabbit