Repository navigation
Soft delete Astra habits through the habit command - #611
Merged
Merged
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes in the two-commit PR against main:
- Astra deletion:
DeleteHabitTooldelegates toDeleteHabitCommand, preserving its lookup response while using the existing soft deletion, cascade, streak and cache behavior. - Bulk creation: Parent and children are built before repository insertion so a failed child does not leave part of the item staged.
- Regression coverage: Tool, failed child creation and reminder scheduler tests exercise the affected paths.
GPT Sol | 𝕏
|
thomasluizon
added a commit
that referenced
this pull request
Sep 27, 2026
* Soft delete Astra habits through the habit command (#611) * Route Astra habit deletion through soft delete command * Avoid direct habit removal during bulk create validation (cherry picked from commit b953e5d) * fix: increment habit reminder probe atomically (#612) (cherry picked from commit 43d847e)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Fixes thomasluizon/orbit-tickets#781.
Change
DeleteHabitToolthroughDeleteHabitCommand. The command enforces ownership, runs validation, soft deletes the full subtree, updates streaks, and invalidates caches. The tool keeps its existing success fields and lookup error response.Habits.Removecall from normal habit flows when child validation fails.DeleteHabitToolTests.csandSchedulerProjectionTests.cs. Add failed child validation coverage inBulkCreateHabitsCommandHandlerTests.cs.Assumptions
Test evidence
dotnet test tests/Orbit.Application.Tests --filter 'FullyQualifiedName~DeleteHabitToolTests' -v normalpassed all 5 existing tests, includingSuccessfulDelete_ReturnsSuccessAndRemovesHabit, with the hard delete present.dotnet test tests/Orbit.Application.Tests --filter 'FullyQualifiedName~DeleteHabitToolTests.SuccessfulDelete_ReturnsSuccessAndSoftDeletesHabit' --no-restore -v quietfailed because the habit was not soft deleted.dotnet test tests/Orbit.Infrastructure.Tests --filter 'FullyQualifiedName~ReminderTick_AstraDeleteAndReplacement_RefreshesCandidates' -v quietfailed: the scheduler sentOld reminderand did not sendNew reminder.dotnet test tests/Orbit.Application.Tests --filter 'FullyQualifiedName~Handle_InvalidLaterSubHabit_DoesNotAddAnyPartOfItem' -v quietfailed because the parent and first child were added before the later child failed validation.dotnet test tests/Orbit.Application.Tests --filter 'FullyQualifiedName~DeleteHabitToolTests|FullyQualifiedName~BulkCreateHabitsCommandHandlerTests' -v quietpassed 21 tests. The scheduler regression passed as well.dotnet build Orbit.slnx -v quietpassed with 0 errors.dotnet test -v quietpassed all 6,751 tests.git grepforhabitRepository.RemoveandHabits.Removeundersrcandtestsfound no matches.