Skip to content

feat: add random write API for store files (storeFileRw*) - #19

Draft
kisielewski wants to merge 2 commits into
devfrom
feat/store-file-random-write-api
Draft

feat: add random write API for store files (storeFileRw*)#19
kisielewski wants to merge 2 commits into
devfrom
feat/store-file-random-write-api

Conversation

@kisielewski

@kisielewski kisielewski commented May 29, 2026

Copy link
Copy Markdown
Member

Summary

  • Introduces three new endpoints for random-write store files: storeFileRwCreate, storeFileRwWrite, storeFileRwPull
  • Adds StoreFileRwVersion and StoreFileRwMeta branded types, renames randomWriteMeta fields to rwVersion/rwMeta for consistency across the API
  • Extends storeFileRead with an optional rwVersion parameter and adds a dedicated STORE_FILE_RW_VERSION_MISMATCH error (code 0x6140)

New endpoints

storeFileRwCreate — creates a new random-write file. Client provides rwMeta; server initializes rwVersion to 1.

storeFileRwWrite — applies random-write operations with optimistic locking. Client passes current rwVersion (fetched via storeFileRwPull); server rejects with INVALID_VERSION if it doesn't match.

storeFileRwPull — fetches current randomWriteMeta and checksums. Accepts optional version (file update version); if the file has changed since the client's known version, the response also includes updated store and file objects.

Replace per-operation count and size limits with a single validator
(storeFileOperations) that enforces a 5MB cap on the total combined
size of all operation data fields in a single storeFileWrite request.
Introduces three new endpoints for random-write store files:
- storeFileRwCreate – creates a file with initial rwMeta (rwVersion set to 1 by server)
- storeFileRwWrite – applies random-write operations with optimistic locking on rwVersion
- storeFileRwPull – fetches current randomWriteMeta and checksums; optionally returns updated store/file when client's version is stale

Adds StoreFileRwVersion and StoreFileRwMeta branded types, renames randomWriteMeta fields to rwVersion/rwMeta for consistency, and introduces a dedicated STORE_FILE_RW_VERSION_MISMATCH error code (0x6140). Extends storeFileRead with an optional rwVersion check.
@kisielewski kisielewski self-assigned this May 29, 2026
@kisielewski
kisielewski requested a review from imaTik0 May 29, 2026 13:57
@imaTik0
imaTik0 changed the base branch from feat/store-operations-data-size-limit to dev June 16, 2026 14:25
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