fix: refactor use natives to drop md5-file and multistream#888
fix: refactor use natives to drop md5-file and multistream#888ferhatelmas merged 1 commit intomasterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThis PR removes runtime dependencies "md5-file" and "multistream" from the file storage backend by internalizing MD5 hashing and multipart stream merging. It adds private helpers Sequence Diagram(s)sequenceDiagram
actor Client
participant StorageBackend
participant FileSystem
participant Crypto
participant UploadService
participant ObjectStore
Client->>StorageBackend: Request multipart upload (finalParts)
StorageBackend->>FileSystem: Open part files (create ReadStreams)
StorageBackend->>Crypto: computeMd5(partPath) for ETag
Crypto-->>StorageBackend: MD5 hash
StorageBackend->>StorageBackend: mergePartStreams(finalParts) -> multipartStream
StorageBackend->>UploadService: uploadObject(name, multipartStream, etag)
UploadService->>ObjectStore: stream data -> store object
ObjectStore-->>UploadService: upload result
UploadService-->>StorageBackend: upload result
StorageBackend-->>Client: Finalize response
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
447ec0a to
feb370c
Compare
Signed-off-by: ferhat elmas <elmas.ferhat@gmail.com>
feb370c to
9e34653
Compare
What kind of change does this PR introduce?
Refactor
What is the current behavior?
Using three dependencies for file-backend (md5-file, multistream and its types).
What is the new behavior?
They can be replaced with their native counterparts (
crypto.createHashandReadable.from).Additional context
Less dependencies, less surface.