MediaReplicaReadyPayload media.replica.ready@1

Generated at from openvibe-contracts v0.97.0 and openvibe-sdk v0.26.0.

Version
1.0.0
Owner
media
Visibility
first-party
Status
active
Compatibility
backward
Schema
https://openvibe.network/contracts/events/payloads/media.replica.ready.v1.json

media.replica.ready v1 (OpenVibe.Media server/objects/tiering.js promote(), the recordPlacement in the transaction that upserts the verified media_locations row; PR #18). A replica finished copying and verified: the bytes read back from the target provider hash to the object's recorded content_hash before this is recorded. The payload carries where the copy lives and how big it is, so consumers and the placement view can act without reading the object API. A media.replica.requested with no ready for the same object is a copy that never verified (the bytes are removed, nothing was recorded). Envelope: subject { type: object, id: <object_id> }, visibility internal, priority low, actor service:media, source media. Sandbox tenants produce none.

Fields

FieldTypeRequiredDescriptionConstraints
object_idstringyes
  • pattern ^med_[0-9A-HJKMNP-TV-Z]{26}$
app_idstring | nullyesThe tenant that owns the object: an app (live, tools…) or a developer project's production tenant (prj_…); null when the object has no tenant.
  • minLength 1
  • maxLength 200
classenumyesThe placement class the move was budgeted against (media.storage_policy classes; tiering.classOf).
  • one of "video", "image", "download", "game-asset", "attachment", "backup"
actionenumyespromote placed a copy on the provider, demote removed one.
  • one of "promote", "demote"
providerenumyesThe provider that now holds the verified replica.
  • one of "local", "b2", "r2"
keystringyesThe object key of the replica in the provider's bucket.
  • minLength 1
  • maxLength 1024
bytesintegeryesThe size in bytes that was copied and verified.
  • minimum 0
replica_sincestringyesWhen the verified replica was recorded, ISO 8601 UTC; a fresh row restarts the demotion residency clock.
  • format date-time

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: promoted-video
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "class": "video",
  "action": "promote",
  "provider": "r2",
  "key": "vods/med_01JAB2C3D4E5F6G7H8J9K0MNPQ.mp4",
  "bytes": 1048576,
  "replica_since": "2026-10-03T12:00:00.000Z"
}
Rejected: negative-bytes
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "class": "video",
  "action": "promote",
  "provider": "r2",
  "key": "vods/med_01JAB2C3D4E5F6G7H8J9K0MNPQ.mp4",
  "bytes": -1,
  "replica_since": "2026-10-03T12:00:00.000Z"
}
Rejected: no-key
{
  "object_id": "med_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "app_id": "live",
  "class": "video",
  "action": "promote",
  "provider": "r2",
  "bytes": 1048576,
  "replica_since": "2026-10-03T12:00:00.000Z"
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('media.replica.ready@1', value);   // { valid, errors: [{ path, message }] }