Skip to content

fix: expose descendant log dates in calendar month (#984) - #671

Merged
thomasluizon merged 1 commit into
mainfrom
fix/ticket-984-subhabit-log-dates
Sep 30, 2026
Merged

thomasluizon merged 1 commit into
mainfrom
fix/ticket-984-subhabit-log-dates

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Flexible and completed sub-habits have empty Instances, so the calendar could not identify their logged days. GetCalendarMonthQuery.cs now includes every loaded habit ID, including descendants, in the existing Logs dictionary. This reuses the existing log DTO and range filtering without changing schedule mapping or existing top-level entries. Old clients can continue reading only top-level IDs.

GetCalendarMonthQueryHandlerTests.cs covers flexible, completed one-time, and completed recurring children and grandchildren. Recurring fixtures complete through real domain logging, then move their due date back through Habit.Update while retaining completion. Tests also preserve exact log fields, descending order, inclusive range boundaries, and zero-valued skip entries. No DTO fields, routes, validators, domain rules, database schema, or minimum client version change.

Closes thomasluizon/orbit-tickets#984. The consumer change remains in its blocked UI ticket #985.

Test evidence

Command for each regression observation: dotnet test tests/Orbit.Application.Tests --filter FullyQualifiedName~GetCalendarMonthQueryHandlerTests.

  • Before changing tests or implementation: all 12 original tests passed with the defect present, including Handle_LoggedChild_KeepsParentInMonth.
  • With tests strengthened and implementation unchanged: 8 failed and 11 passed. Handle_LoggedChild_KeepsParentInMonth failed at the new descendant dictionary-key assertion. All six cases of Handle_LoggedFlexibleOrCompletedDescendant_ReturnsExactLogs failed because their descendant ID was missing, after asserting the real completed/flexible state and empty instances. Handle_DescendantLogs_PreservesRangeOrderingAndTopLevelLogs failed because the child dictionary key was missing.
  • After removing the top-level-only filter: all 19 handler tests passed.
  • dotnet build Orbit.slnx: passed with zero errors; existing dependency and obsolete API warnings remain.
  • dotnet test: passed all 7,033 tests with zero failures and zero skips (Application 3,746; Domain 640; Infrastructure 2,615; Analyzers 32).
  • Pre-commit hooks passed: formatting, root allowlist, dash ban, timeless prose, and suppression allowlist. Changed C# files contain no bare narration comments.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes Reviewed the complete API change, regression tests, and shared web/mobile calendar consumers.

  • Descendant log exposure: BuildLogsDict now includes all loaded habit IDs, preserving existing log fields, inclusive range filtering, descending ordering, and top-level entries.
  • Regression coverage: Tests cover flexible and completed children/grandchildren with empty instances, exact log DTOs, range boundaries, ordering, and zero-valued skips. The targeted calendar handler suite passed all 19 tests.
  • Client compatibility: The shared logs record accepts descendant keys without a contract change. Rendering these dates still depends on the planned consumer ticket #985; this API-first change does not regress the existing client path.

Pullfrog  | View workflow run | Using openai/gpt-6.1-sol | 𝕏

@sonarqubecloud

Copy link
Copy Markdown

@thomasluizon
thomasluizon merged commit 2b1fecf into main Sep 30, 2026
26 checks passed
@thomasluizon
thomasluizon deleted the fix/ticket-984-subhabit-log-dates branch September 30, 2026 22:51
thomasluizon added a commit that referenced this pull request Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant