Add repairable streak gap dates - #518
Conversation
|
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. |
There was a problem hiding this comment.
✅ 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.
GPT Sol | 𝕏
|
There was a problem hiding this comment.
✅ 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
RepairableGapDatestoStreakInfoResponseand 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-mobilePR #894 is waiting for this field before adding the client contract and multi-day action.
GPT Sol | 𝕏




Closes thomasluizon/orbit-tickets#505
A bare
#505in this repository resolves toorbit-apipull 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
RepairableGapDateslist toStreakInfoResponse. Resolve the list inUserStreakServicefrom the same scheduled occurrence set and the same continuity, predecessor, monthly cap, and streak improvement checks used by gap repair. KeepIsRepairAvailableandRepairDateunchanged for existing clients. Update the generated OpenAPI contract and cover the response through the real streak query and repair command composition.Test evidence
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.WeeklyTwoOccurrenceGap_IsReturnedAndAcceptedWhenEchoedresponse-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 withCS1061becauseStreakInfoResponsedid not defineRepairableGapDates.dotnet test tests/Orbit.Infrastructure.Tests/Orbit.Infrastructure.Tests.csproj --filter "FullyQualifiedName~StreakGapRepairTests"passed 34 of 34, including the weekly two-occurrence echo throughRepairStreakGapCommand.dotnet test tests/Orbit.Application.Tests/Orbit.Application.Tests.csproj --filter "FullyQualifiedName~GetStreakInfoQueryHandlerTests"passed 10 of 10.dotnet build Orbit.slnxcompleted with 0 errors.dotnet testpassed all 6,169 tests with 0 failures.