Skip to content

Add repairable streak gap dates - #518

Open
thomasluizon wants to merge 2 commits into
mainfrom
feature/ticket-505-repair-gap
Open

Add repairable streak gap dates#518
thomasluizon wants to merge 2 commits into
mainfrom
feature/ticket-505-repair-gap

Conversation

@thomasluizon

@thomasluizon thomasluizon commented Sep 11, 2026

Copy link
Copy Markdown
Owner

Closes thomasluizon/orbit-tickets#505

A bare #505 in this repository resolves to orbit-api pull request 505, "Add atomic streak gap repair (#442)", which is a different and already merged change. The backing ticket lives in the private ticket repository.

Approach

Append an optional RepairableGapDates list to StreakInfoResponse. Resolve the list in UserStreakService from the same scheduled occurrence set and the same continuity, predecessor, monthly cap, and streak improvement checks used by gap repair. Keep IsRepairAvailable and RepairDate unchanged for existing clients. Update the generated OpenAPI contract and cover the response through the real streak query and repair command composition.

Test evidence

  • Before implementation at 5d11beaa, dotnet test tests/Orbit.Infrastructure.Tests/Orbit.Infrastructure.Tests.csproj --filter "FullyQualifiedName~WeeklyGapWhosePriorOccurrenceIsAWeekBack_IsRepairable" passed 1 of 1. The existing test proved that weekly repair validation accepted a scheduled gap, but did not cover the missing read contract.
  • With the strengthened WeeklyTwoOccurrenceGap_IsReturnedAndAcceptedWhenEchoed response-path test placed against the same pre-fix production code, dotnet test tests/Orbit.Infrastructure.Tests/Orbit.Infrastructure.Tests.csproj --filter "FullyQualifiedName~WeeklyTwoOccurrenceGap_IsReturnedAndAcceptedWhenEchoed" failed at compile time with CS1061 because StreakInfoResponse did not define RepairableGapDates.
  • After implementation, dotnet test tests/Orbit.Infrastructure.Tests/Orbit.Infrastructure.Tests.csproj --filter "FullyQualifiedName~StreakGapRepairTests" passed 34 of 34, including the weekly two-occurrence echo through RepairStreakGapCommand.
  • dotnet test tests/Orbit.Application.Tests/Orbit.Application.Tests.csproj --filter "FullyQualifiedName~GetStreakInfoQueryHandlerTests" passed 10 of 10.
  • dotnet build Orbit.slnx completed with 0 errors.
  • dotnet test passed all 6,169 tests with 0 failures.

@thomasluizon

Copy link
Copy Markdown
Owner Author

Approach: append an optional repairable gap date list to StreakInfoResponse, derive it inside UserStreakService from the same scheduled occurrence sequence and boundary rules used by repair validation, and add focused unit coverage for daily and weekly gaps, invalid predecessor and lookback boundaries, completion today, plus echoing the weekly list through repair-gap. This keeps the existing single-day contract unchanged and avoids duplicating schedule logic in clients.

pullfrog[bot]
pullfrog Bot previously approved these changes Sep 11, 2026

@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 This revision contains the initialization commit only.

  • Empty setup commit — No files differ from main, so the repairable streak gap response, service logic, contract changes, and tests described in the PR body are not present to review yet.

Pullfrog  | View workflow run | Using GPT Sol𝕏

@sonarqubecloud

Copy link
Copy Markdown

@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 repairable gap date implementation added since the prior Pullfrog review.

  • Extended the streak contract: Appended nullable, non-required RepairableGapDates to StreakInfoResponse and regenerated OpenAPI without breaking installed clients.
  • Derived server-authoritative candidates: Built the complete missed scheduled run from the user's local date and reused the write path's continuity, predecessor, monthly quota, and streak improvement evaluation.
  • Covered read and write composition: Added daily and sparse weekly cases, rejection boundaries, completion-today behavior, exact response projection, and an echo through RepairStreakGapCommand.
  • Preserved API-first rollout: Confirmed paired orbit-ui-mobile PR #894 is waiting for this field before adding the client contract and multi-day action.

Pullfrog  | View workflow run | Using GPT Sol𝕏

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