Fix immutability violations and redundant initialization in F1 replay sources#13
Merged
codegefluester merged 5 commits intofeat/f1-replay-sourcefrom Feb 11, 2026
Merged
Conversation
Merged
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add F1 replay file sources for detection
Fix immutability violations and redundant initialization in F1 replay sources
Feb 11, 2026
codegefluester
approved these changes
Feb 11, 2026
codegefluester
added a commit
that referenced
this pull request
Feb 11, 2026
* F1 replay file sources * Fix immutability violations and redundant initialization in F1 replay sources (#13) * Initial plan * Fix EnsurePath to return new instances and update foreach to Select Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Extract debounce delay constants for better maintainability Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Add clarifying comments and improve variable naming Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Document library default coupling in constant Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> --------- Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
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.
The F1 replay source classes mutated input
FileWatcherOptionsinstead of returning new instances, and performed redundant double-initialization. Additionally, the debounce delay default logic failed to override the library's 1s default.Changes
Immutable options pattern:
EnsurePathmethods now return newFileWatcherOptionsinstances instead of mutating the input parameter (F1RaceReplaySource, F12022-2025RaceReplaySource)Simplified initialization: Removed redundant
EnsurePathcall in options-based constructors;ApplyDefaultsnow handles path defaulting directlyFixed debounce delay detection:
ApplyDefaultsnow checks for bothdefault(00:00:00) and library default (1s) to consistently apply F1's 2s default across constructor pathsCode clarity: Extracted
LibraryDefaultDebounceDelayandF1DebounceDelayconstants; replaced foreach with LINQ.Select()in path detectionBefore
After
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.