Skip to content

WriteChunks: write all chunks before checking insertion status - #372

Merged
fingolfin merged 3 commits into
masterfrom
fix-warning
Aug 28, 2026
Merged

WriteChunks: write all chunks before checking insertion status#372
fingolfin merged 3 commits into
masterfrom
fix-warning

Conversation

@ChrisJefferson

Copy link
Copy Markdown
Member

Writing a chunk whose body contains a nested @InsertChunk marks the inserted chunk as inserted. Previously the "defined but never inserted" and "inserted but never defined" checks were interleaved with writing, so a chunk that was only inserted from within a later-written chunk could be spuriously reported, depending on iteration order. Split the loop: write every chunk first, then run the checks once all insertions have been resolved.

Found while fixing the vole package.

AI disclosure: this change was prepared with the assistance of Claude Code (Anthropic), which diagnosed the ordering issue and drafted the fix.

Writing a chunk whose body contains a nested @InsertChunk marks the
inserted chunk as inserted. Previously the "defined but never inserted"
and "inserted but never defined" checks were interleaved with writing,
so a chunk that was only inserted from within a later-written chunk
could be spuriously reported, depending on iteration order. Split the
loop: write every chunk first, then run the checks once all insertions
have been resolved.

Found while fixing the vole package.

AI disclosure: this change was prepared with the assistance of Claude
Code (Anthropic), which diagnosed the ordering issue and drafted the
fix.

Co-authored-by: Claude <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.20%. Comparing base (2bad29a) to head (dbc75f9).
⚠️ Report is 3 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #372   +/-   ##
=======================================
  Coverage   93.20%   93.20%           
=======================================
  Files          13       13           
  Lines        2956     2958    +2     
=======================================
+ Hits         2755     2757    +2     
  Misses        201      201           
Files with missing lines Coverage Δ
gap/DocumentationTree.gi 96.09% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@fingolfin fingolfin closed this Aug 18, 2026
@fingolfin fingolfin reopened this Aug 18, 2026
fingolfin and others added 2 commits August 28, 2026 09:47
The fix in the previous commit is order-dependent in its failure mode:
it only misbehaves when the nested chunk is defined before the chunk
whose body inserts it. Pin that order down so a regression cannot hide
behind RecNames iteration order.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@fingolfin

Copy link
Copy Markdown
Member

Thanks @ChrisJefferson . My Claude added a test and a changelog entry.

@fingolfin
fingolfin merged commit 90ce1f7 into master Aug 28, 2026
5 checks passed
@fingolfin
fingolfin deleted the fix-warning branch August 28, 2026 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants