Repository navigation
refactor!: remove unused DidWebVhLogEntry.toJson() - #292
Open
marat-affinidi wants to merge 1 commit into
Open
marat-affinidi wants to merge 1 commit into
marat-affinidi wants to merge 1 commit into
Conversation
After verifying SCID/entry-hash over the published JSON (#290), the typed toJson() had no production caller. Removing it prevents reintroducing the bug where the typed round-trip (e.g. single-element service.type arrays) diverges from the signed bytes. BREAKING CHANGE: DidWebVhLogEntry.toJson() has been removed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Coverage after merging chore/webvh-log-tojson-cleanup into main will be
Coverage Report |
Contributor
|
This is an interface change, so this is a breaking change. Let's keep it. |
This branch has not been deployed
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.
What
Removes the now-unused
DidWebVhLogEntry.toJson()method.Why
Follow-up to #290. That fix made SCID and entry-hash verification run over the entry's published JSON (
_sourceJson) instead of a typed round-trip, because rebuilding from typed fields can change the canonical form (e.g. a single-elementservice.typearray collapsing to a string) and break the recomputed SCID.After that change,
DidWebVhLogEntry.toJson()has no production caller — this is a read/resolve-only library with no log-writing/signing path. Its only remaining use was one date-format unit test. Keeping it around is a footgun: it invites re-serializing the typed model for hashing, which is exactly the bug #290 fixed.This addresses the review question on #290 about whether
toJson()should stay.Changes
DidWebVhLogEntry.toJson().DidWebVhLogEntryProof.toJson()) remains.Breaking change
DidWebVhLogEntry.toJson()is public (exported vialib/ssi.dart) and has been removed.Verification
dart analyze— no issues.dart test test/did/did_webvh/— all 152 tests pass (incl. the fix: verify did:webvh SCID over the published log entry #290 SCID regression).