Skip to content

Conversation

@lukemelia
Copy link
Contributor

Summary

  • Add a POST route for application/octet-stream that accepts binary uploads (images, etc.) and writes them through the existing Realm.write() pipeline
  • Widen write signatures across RealmAdapter, NodeAdapter, TestRealmAdapter, and Realm to accept string | Uint8Array
  • Widen validateWriteSize() to handle Uint8Array directly
  • Add typeof content === 'string' guards in _batchWrite() so JSON parsing and card document detection are skipped for binary content
  • Same size limit (512KB default) and response shape (204, last-modified, x-created) as upsertCardSource

Closes CS-10076

Test plan

  • New binary upload tests: basic upload, file metadata, overwrite, realm events, size limit (413), permissions (401/403/204)
  • Existing card-source endpoint tests pass without regressions

🤖 Generated with Claude Code

@github-actions
Copy link

Preview deployments

@lukemelia lukemelia force-pushed the cs-10076-realm-endpoint-for-writing-a-binary-file branch from 6cc9a9c to c1b01d1 Compare January 30, 2026 05:05
Add a POST route for `application/octet-stream` that accepts binary
uploads (images, etc.) and writes them through the existing
`Realm.write()` pipeline. Widens write signatures across the adapter
interface, node adapter, test adapter, and realm methods to accept
`string | Uint8Array`. Applies the same size limit and response shape
as `upsertCardSource`.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@lukemelia lukemelia force-pushed the cs-10076-realm-endpoint-for-writing-a-binary-file branch from c1b01d1 to 7961c65 Compare January 30, 2026 05:05
@github-actions
Copy link

Host Test Results

    1 files  ±0      1 suites  ±0   1h 43m 36s ⏱️ +6s
1 925 tests ±0  1 908 ✅ ±0  17 💤 ±0  0 ❌ ±0 
1 940 runs  ±0  1 923 ✅ ±0  17 💤 ±0  0 ❌ ±0 

Results for commit 7961c65. ± Comparison against base commit bc47720.

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.

2 participants