Skip to content

Support binary files in Realm _atomic operations #5666

Description

@christse

Problem

Boxel supports immediate binary file writes through the octet-stream Realm endpoint and BoxelCLIClient.write(), but _atomic only accepts card and source resources whose payload is JSON/text.

Realm Program / Realm Script therefore cannot safely expose fs.writeBase64() or binary copy() while preserving its preview and all-or-nothing commit contract. Performing an immediate octet-stream POST from inside the program would make failures after that call impossible to roll back.

Expected behavior

Extend _atomic with a binary-resource representation that can add/update binary files in the same Realm write transaction as source/card changes.

Acceptance criteria

  • _atomic accepts a documented binary add/update representation, including content type and bytes (base64 or another JSON-safe encoding).
  • Binary writes participate in the same Realm write lock and all-or-nothing failure behavior as source/card operations.
  • File-size limits, authorization, cache invalidation, indexing, notifications, and content-type inference match the existing octet-stream endpoint.
  • Mixed text + binary batches are tested for success and rollback.
  • BoxelCLIClient.atomicOperation() and its exported types represent binary operations without an untyped workaround.
  • Realm Script can stage binary writes in preview mode and commit them only after successful program completion.

Context

Realm Script now supports bounded readBase64() for text and binary files. Transactional binary output is the missing half needed for asset copying and generation workflows.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions