Skip to content

feat(client-contract): add the ref_digest_changed client warning - #18

Merged
jm-rivera merged 1 commit into
devfrom
feat/warning-ref-digest-changed
Oct 23, 2026
Merged

jm-rivera merged 1 commit into
devfrom
feat/warning-ref-digest-changed

Conversation

@jm-rivera

Copy link
Copy Markdown
Contributor

A DatasetRef records the digest of one rendering of a content_version. When the server renders that version again, a client fetching the ref downloads a file with another digest. The SDK clients now return the data and warn, naming both digests, but warning-codes.json held no code for a warning a client issues itself in that case, and DataWarning with digest_mismatch would have mixed a server manifest warning with the ServerError for a download that fails its hash.

warning-codes.json gains ref_digest_changed, class DfoWarning, sorted before route_deprecated. tools/validate_client_contract.py adds it to the codes the client rules issue, so _check_warning_codes requires the row, and tools/tests/test_validate_client_contract.py gains a row that drops it and expects the missing-row problem. The README's warning-code sentence and the CHANGELOG name it, and the CHANGELOG count moves from five codes to six. No recorded scenario issues the warning yet.

Testing: uv run tools/validate_client_contract.py printed client contract valid: 101 action rows, 23 client codes, 29 required and 8 enum pointers, 118 scenarios. pytest tools/tests passed 518 tests; in python/client-contract, pytest passed 78, and ruff check, ruff format --check and ty check passed.

A ref names one rendering's digest. When the server renders the same
content_version again, the file a client downloads hashes differently,
and the client returns the data. warning-codes.json gains
ref_digest_changed, a DfoWarning, so both clients issue that warning
with a code the contract lists, and the validator requires the row.
@jm-rivera
jm-rivera merged commit ec9fb5d into dev Oct 23, 2026
19 checks passed
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.

1 participant