rpc_blob 2.3.0
rpc_blob: ^2.3.0 copied to clipboard
Streamed blob storage contract and RPC wiring for rpc_dart (binary/object storage alongside rpc_data).
2.3.0 #
Changed #
- Requires rpc_dart 6. See its changelog — notably that a handler's bare
Exceptiontext no longer reaches the caller, so a storage error now needs anRpcStatusExceptionto say anything to the peer.
2.2.0 #
Changed #
- Requires rpc_dart 5. See its changelog: flow control is on by default, an
expired deadline is now
RpcDeadlineExceededExceptionon every shape, and a stream that ends without a trailer raisesUNAVAILABLE.
2.1.0 #
applyBulkDeletereturns results positionally aligned with the request, the same asapplyBulkHead. It used to emit version-checked ids first and the batched ones after, grouped by collection — one result per request, but not in request order, so a caller pairing the two by index read another id's verdict. Grouping is how the work is issued, not how it is reported.
2.0.0 #
Prepares the blob layer for a hosted S3, where a round trip is billed and a bucket is a scarce resource. The interface changes are breaking.
Breaking:
IBlobRepository.collectionSizereturnsFuture<int?>. Null means the backend cannot answer without walking the whole store; 0 still means empty. The cost of this call ranges from an indexed query to a full enumeration depending on the backend, and a plaininthid that well enough for it to end up on a request path. Callers that need the number regardless sumlistBlobsthemselves, where the cost is visible.CollectionSizeResponse.sizeBytesis nullable to match.- Three methods join
IBlobRepository, so any implementation outside this repository must add them:ensureCollection,deleteMany,headMany.
Batching:
deleteManyandheadManylet a backend answer a batch the way it can — one statement on SQLite,DeleteObjectson S3, bounded parallel HEADs where there is no batch metadata call.bulkDeleteBlobandbulkHeadBlobwere loops over single-blob calls in both the RPC responder and the in-process repository client; both now shareapplyBulkDelete/applyBulkHead. Fixing only the responder would have left the in-process path — the one a server holding a repository directly uses — still walking ids one round trip at a time.- Version-checked deletes stay one at a time: that check is per id, while a batch delete is unconditional.
Lifecycle:
ensureCollectionmakes setting a collection up an explicit act, so stores no longer have to re-discover its absence on every write.
1.2.2 #
Web/dart2js correctness (verified on node):
InMemoryBlobRepositoryblob-id generation falls back fromRandom.secure()toRandom()when secure randomness is unavailable in the runtime (e.g. node/dart2js without a properglobalThiscrypto binding). Blob ids are not secrets, so this is a safe cross-platform compromise that no longer throws at startup on web.- Added
test/web_smoke_test.dart(runs onvm || node) exercising the full RPC client round-trip (put/get/list) and a mid-downloadgetserver-stream cancel; confirmed the client surface has nodart:ioleak and the streaminggetcancel does not deadlock on dart2js.
1.2.1 #
Bug fix:
BlobUploadChunk.toJson()andBlobDownloadFrame.toJson()now coercebytesviaUint8List.fromList()to guarantee correct CBOR byte string encoding on dart2js._bytesFromJsonValuehandlesList<dynamic>(from CBOR array decoding) as a fallback for cross-platform compatibility.- Bumped
rpc_dartdependency to^3.1.0.
1.0.5 #
- Allow to pass raw sqlite db connection to adapter
1.0.4 #
- S3 adapter now auto-detects public buckets and returns plain download URLs when anonymous
s3:GetObjectis allowed; presigning is used only for private buckets, still honoringpresign*host overrides.
1.0.3 #
- Added presign-only endpoint overrides (
presignEndpoint/presignPort/presignUseSSL/presignPathStyle) for S3/MinIO to sign links on a public host behind a reverse proxy; removeddownloadUrlMapperto avoid generating invalid signatures.
1.0.2 #
- S3 adapter can rewrite presigned download URLs via
S3BlobStorageOptions.downloadUrlMapper(useful for serving through a proxy/CDN) and configure presign TTL viaS3BlobStorageOptions.presignTtlSeconds; constructor params consolidated intoS3BlobStorageOptions.
1.0.1 #
- S3 adapter now fetches object tags (
?tagging) and merges them intoBlobDescriptor.metadatawithout overwriting metadata provided on upload. - Added
xmldependency to parse S3 tag responses.
1.0.0 #
- Added
S3BlobStorageAdapter(S3/MinIO/Ceph-compatible) storing blobs under<prefix><collection>/<id>with metadata-based versioning and optimistic checks. - New
S3BlobStorageAdapter.connect(...)helper for quick setup; list/Head/read/write/delete/listCollections wired to S3 operations; descriptors include a presigned download URL. - README now documents S3/MinIO usage; pubspec updated with the MinIO client dependency.
- Initial version.