Conversation
URI distinguishes an absent component from an empty one using a sentinel SubString (`absent`) identified by object identity (`===`). The default Serialization machinery round-trips field values but not object identity, so a deserialized URI's components were no longer `===` to `absent`, corrupting URIs built from components (e.g. a `file:` URI gaining a bogus empty authority). Serialize/deserialize through the URI string instead. Fixes JuliaWeb#75 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #76 +/- ##
==========================================
+ Coverage 86.91% 87.56% +0.65%
==========================================
Files 5 5
Lines 382 402 +20
==========================================
+ Hits 332 352 +20
Misses 50 50 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks! One blocker: this breaks data serialized by existing releases. The old format has eight fields, but the new reader consumes only one, which misaligns the stream. For example: # Written by the current release, then read by this PR:
(URI(; scheme="file", path="some/relative/path.pdf"), 42)
# Becomes:
(URI(""), "file")Could we add a format marker, a backward-compatible reader, and a regression test with a trailing value? |
|
Thanks, the stream-alignment issue is fixed. One legacy case remains: empty components are always converted to absent. A v1.7-serialized URI("http://example.com?") loses the ? after a later component update. Could we reparse a nonempty cached uri after consuming the legacy fields and add a regression test for this case? Cacheless legacy values can keep the documented best-effort fallback. |
URI distinguishes an absent component from an empty one using a sentinel SubString (
absent) identified by object identity (===). The default Serialization machinery round-trips field values but not object identity, so a deserialized URI's components were no longer===toabsent, corrupting URIs built from components (e.g. afile:URI gaining a bogus empty authority). Serialize/deserialize through the URI string instead.Fixes #75
Written by Claude Opus and manually checked.