Commit 2c92781
fix: resolve 14 code-review issues across Core/Differential/Bowl/Drivelution/Extension (#513)
* fix: resolve 14 code-review issues across Core/Differential/Bowl/Drivelution/Extension
## Bug fixes
- **Brotli patch detection**: add BrotliFormatVersion (0x02) to format detection
and decompression switch in BsdiffDiffer (#512)
- **ReadFileWithBudget**: trim buffer to actual bytes read to prevent zero-padded
data corrupting patch computation (#512)
- **BsdiffDiffer.Search**: guard against sentinel -1 values from Split() that
would cause IndexOutOfRangeException (#512)
- **Bowl EnsureDirectory**: stop deleting the fail directory on every Prepare()
call — preserves crash diagnostics from prior sessions (#512)
- **FileNode.Equals**: return false for incompatible types instead of throwing
ArgumentException, conforming to the IEquatable contract (#512)
- **EventManager.Dispatch**: snapshot the delegate invocation list before
enumerating to avoid race with concurrent AddListener/RemoveListener (#512)
- **DiffPipeline**: add 'using' to both SemaphoreSlim instances to fix kernel
handle leaks (#512)
- **FileTree.Compare**: guard all 'node0' access paths with null-conditional
operators to prevent NullReferenceException (#512)
- **ClientStrategy.CheckFail**: use Version.TryParse instead of bare
new Version() to avoid crashing on malformed version strings (#512)
- **GeneralTracer**: wrap InitializeFileListener with lock to prevent duplicate
TextTraceListener creation on concurrent day-rollover (#512)
- **ProcessRunner**: cancel the Task.Delay timer via CancellationTokenSource
when the process exits first, preventing timer leak (#512)
- **OssStrategy**: resolve upgrade app name and search pattern based on
RuntimeInformation.IsOSPlatform instead of hardcoding .exe (#512)
- **VersionComparer**: use long instead of int for major/minor/patch to
prevent overflow on extremely large version numbers (#512)
- **ExtensionGeneralHost**: move name extraction before lifecycle hook calls
and use extensionName (not file path) as Id in ExtensionMetadata (#512)
## Test coverage
- BsdiffDifferTests: 6 new edge-case tests (single-byte, two-byte, repeating
patterns, single-byte-change round-trips)
- VersionComparerTests: 3 new large-number overflow tests
- FileTreeTests: 6 new tests for null node0, imbalanced trees, matching trees
- FileNodeTests: update Equals_NonFileNodeType test to match new behaviour
All 1864 tests pass across 5 test suites (0 failures).
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: address 5 Copilot review suggestions
1. BsdiffDiffer: recognize Brotli marker (0x02) as extended-header format
even on netstandard2.0 (fail-fast) instead of mis-detecting as legacy BZip2
2. VersionComparer.ParseVersion: use TryParseNumeric with overflow guard
instead of bare long.Parse (can throw on > Int64 values)
3. VersionComparer.ComparePrerelease: add IsNumericString fallback for
purely-numeric identifiers that exceed long.MaxValue (length+ordinal)
4. OssStrategy: limit diagnostic file listing to 20 entries to prevent
unbounded log noise on non-Windows
5. VersionComparerTests: fix doc comment (long.MaxValue -> int.MaxValue)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 4bc591a commit 2c92781
18 files changed
Lines changed: 397 additions & 72 deletions
File tree
- src/c#
- GeneralUpdate.Bowl/Strategies
- GeneralUpdate.Core
- Event
- FileSystem
- Pipeline
- Strategy
- Tracer
- GeneralUpdate.Differential/Differ
- GeneralUpdate.Drivelution/Core/Utilities
- GeneralUpdate.Extension/Core
- tests
- CoreTest/FileSystem
- DifferentialTest/Differ
- DrivelutionTest/Utilities
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
278 | | - | |
279 | | - | |
280 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
281 | 283 | | |
282 | 284 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
61 | 62 | | |
62 | 63 | | |
63 | 64 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| 75 | + | |
72 | 76 | | |
73 | 77 | | |
74 | 78 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
67 | | - | |
68 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
122 | 128 | | |
123 | 129 | | |
124 | | - | |
| 130 | + | |
125 | 131 | | |
126 | 132 | | |
127 | 133 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
236 | | - | |
| 235 | + | |
237 | 236 | | |
238 | 237 | | |
239 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
212 | | - | |
| 212 | + | |
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | 216 | | |
217 | | - | |
| 217 | + | |
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
228 | | - | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
222 | 222 | | |
223 | 223 | | |
224 | 224 | | |
225 | | - | |
| 225 | + | |
226 | 226 | | |
227 | 227 | | |
228 | 228 | | |
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
345 | | - | |
| 345 | + | |
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
903 | 903 | | |
904 | 904 | | |
905 | 905 | | |
906 | | - | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
907 | 910 | | |
908 | 911 | | |
909 | 912 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
258 | 259 | | |
259 | 260 | | |
260 | 261 | | |
261 | | - | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
262 | 265 | | |
263 | 266 | | |
264 | 267 | | |
265 | | - | |
| 268 | + | |
266 | 269 | | |
267 | 270 | | |
268 | | - | |
269 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
270 | 281 | | |
271 | 282 | | |
272 | 283 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 37 | + | |
43 | 38 | | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
49 | 43 | | |
50 | | - | |
51 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
52 | 54 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
58 | 61 | | |
59 | 62 | | |
60 | 63 | | |
| |||
0 commit comments