Repository navigation
fix: prevent task overwrites when filenames collide - #102
Open
ShubhSingh wants to merge 2 commits into
Open
ShubhSingh wants to merge 2 commits into
ShubhSingh wants to merge 2 commits into
Conversation
arefbehboudi
requested changes
Oct 31, 2026
arefbehboudi
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @ShubhSingh , nice fix!
Two small things:
- Needs a rebase, it conflicts with #103.
- Please write the content directly with
StandardOpenOption.CREATE_NEWinstead of creating an empty file first. Right now a failed write leaves an empty file that breaksgetTasksfor that day.
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.
Creating two tasks with the same name within the same second currently produces the same task ID and truncates the first task file. Different names can also collide after sanitization (for example,
check mailandcheck?mail). Both queued jobs then refer to the same file.This change reserves each new task path with atomic
Files.createFile. An existing filename is retried with a numeric suffix. Updates keep using the existing task ID, and the original filename is retained when there is no collision.Regression coverage
Validation
The first two regression tests failed on upstream
d0600b4before the fix. All 11FileSystemTaskRepositoryTestcases pass after it, including the concurrent case. The published files were fetched and compared against the locally tested working tree with no differences.git diff --checkpasses.Commands (Java 25):
The broader base suite ran 103 tests: 99 passed and 4 failed. All four failures also reproduce in an untouched checkout of
d0600b4on this Windows machine:YamlParserTest.parseMultiLineFrontmatterValue, two TaskHandler filename tests, andSkillsJarSupportTest.loadsSkillsFromJarResource. They are not introduced by this change. For the broader local run, Mockito was supplied with an external Gradle init script as a JVM javaagent to avoid a local attach failure; repository build settings are unchanged.No live LLM, external messaging service, or paid API was used. This prevents new-task filename collisions; it does not add atomic replacement of existing task contents or coordination of simultaneous updates to the same existing task.