[repo-assist] Dispose sitemap file stream after deserialization - #1451
Merged
BenjaminMichaelis merged 1 commit intoOct 3, 2026
Merged
BenjaminMichaelis merged 1 commit into
BenjaminMichaelis merged 1 commit into
Conversation
Dispose the sitemap file stream after deserialization to avoid leaking a file handle.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
Author
There was a problem hiding this comment.
Threat detection produced a warning for this pull request output.
These changes need to be scrutinized before merge and only merged after a careful manual review.
- Detection reason:
agent_failure - Review workflow run logs: https://github.com/IntelliTect/EssentialCSharp.Web/actions/runs/36970487845
22 tasks
BenjaminMichaelis
approved these changes
Oct 3, 2026
BenjaminMichaelis
marked this pull request as ready for review
October 3, 2026 01:02
BenjaminMichaelis
deleted the
repo-assist/improve-dispose-sitemap-stream-7563b232e6eec5a1
branch
October 3, 2026 01:22
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.
Warning
Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding.
What happened
The threat detection engine failed to produce results.
Review the workflow run logs for details.
🤖 This PR was created by Repo Assist, an automated AI assistant.
Closes no issue; this is a focused maintenance improvement.
Summary
Dispose the
FileStreamopened while loadingChapters/sitemap.jsoninSiteMappingService.Root cause
The constructor passed
File.OpenRead(path)directly toJsonSerializer.Deserialize, leaving the stream undisposed after deserialization and retaining a file handle for the lifetime of the process.Fix rationale
The stream is now held in a
usingdeclaration, so it is disposed immediately after deserialization while preserving the existingSiteMappingsbehavior. The unused import in the same file was removed.Test Status
dotnet restore --ignore-failed-sources— passed.dotnet build --configuration Release --no-restore— passed.dotnet test --configuration Release --no-build— 174 passed; 2 unrelated external-service integration tests failed (CaptchaService_Verify_SuccessandKnownBreachedPassword_IsDetected) because their remote services were unavailable.git diff --check— passed.No breaking changes or new dependencies.
Warning
Firewall blocked 2 domains
The following domains were blocked by the firewall during workflow execution:
api.hcaptcha.comapi.pwnedpasswords.comTo allow these domains, add them to the
network.allowedlist in your workflow frontmatter:See Network Configuration for more information.
Add this agentic workflow to your repo
To install this agentic workflow, run