Skip to content

docs(arfs): name the snapshot body field jsonMetadata, not dataJson - #137

Open
vilenarios wants to merge 1 commit into
mainfrom
fix/arfs-snapshot-jsonmetadata
Open

docs(arfs): name the snapshot body field jsonMetadata, not dataJson#137
vilenarios wants to merge 1 commit into
mainfrom
fix/arfs-snapshot-jsonmetadata

Conversation

@vilenarios

Copy link
Copy Markdown
Contributor

The Snapshot Entity Data section documents the per-entry metadata field as dataJson. Both implementations write and read jsonMetadata.

  • ardrive-webTxSnapshot in lib/utils/snapshots/snapshot_types.dart, serialised by tx_snapshot_to_snapshot_data.dart, and read back in snapshot_item.dart as item['jsonMetadata']
  • ardrive-core-jsTxSnapshot in src/snapshots/snapshot_types.ts

A client written from this page emits a key neither reader looks for, so every entity in its snapshots reads as having no metadata — and silently, because a missing metadata body is a legitimate state for an entry captured for its GQL node alone. Nothing errors; the data is just never there.

dataJson also already means something else in this ecosystem: an entity's own Data JSON custom-metadata fields, in ardrive-core-js src/arfs/arfs_builders/arfs_builders.ts. So the page is not only wrong, it overloads a term with an established and different meaning.

Three further corrections to the same passage:

  • tsSnapshot was a typo for txSnapshot.
  • The prose said the gqlNode object "also contains" the metadata field. It does not — the two are siblings, as the JSON example on this page already showed. Prose and example contradicted each other.
  • The field is a string, and may be null for an entry captured for its GQL node alone. It was described as an object.

This is independent of any current feature work — it is a live documentation bug against every snapshot already on chain.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LFV6xYmFz2meXf5EW2M1FB

The Snapshot Entity Data section documents the per-entry metadata field as
`dataJson`. Both implementations write and read `jsonMetadata`:

- ardrive-web `lib/utils/snapshots/snapshot_types.dart` (`TxSnapshot`,
  serialized by `tx_snapshot_to_snapshot_data.dart`) and read back in
  `snapshot_item.dart` as `item['jsonMetadata']`
- ardrive-core-js `src/snapshots/snapshot_types.ts` (`TxSnapshot`)

A client written from this page emits a key neither reader looks for, so
every entity in its snapshots reads as having no metadata — silently, since
a missing metadata body is a legitimate state. `dataJson` also already means
something else in this ecosystem: an entity's own Data JSON custom metadata
fields, in ardrive-core-js `arfs_builders.ts`.

Three further corrections to the same passage:

- `tsSnapshot` was a typo for `txSnapshot`.
- The prose said the `gqlNode` object "also contains" the metadata field. It
  does not; the two are siblings, as the example on this page already showed.
- The field is a string, and may be null for an entry captured for its GQL
  node alone. It was described as an object.
@vilenarios
vilenarios requested a review from a team as a code owner August 20, 2026 00:47
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