fix: devil's advocate SDK fixes + CI workflow#4
Merged
Conversation
SDK is for server-server programming — users already have their clientId/clientSecret from dexie-cloud.key.
1. bulkCreate: parallel execution via Promise.all (was sequential) 2. _walkForUpload: skip upload for binaries < BLOB_THRESHOLD (4096 bytes) 3. update(): renamed to replace() (PUT = full replace, not partial update) - update() kept as @deprecated alias for backwards compatibility 4. Upload fallback: throw instead of hardcoding '1:{blobId}' when server returns no parseable ref (version is unknown, unsafe to construct ref) 5. toUint8Array: widened signature to include ArrayBufferView; DataView handled correctly via byteOffset/byteLength slicing 6. _walkForRead: parallel downloads via _parallelMap() with MAX_CONCURRENT_DOWNLOADS=6 cap (was fully sequential) 7. DataManager/BlobManager integration: DataManager now accepts optional BlobManager; create() auto-processes uploads, get()/list() auto-resolve BlobRefs. Wired together in DexieCloudClient constructor. 8. generateBlobId(): fallback uses crypto.getRandomValues() for strong entropy (was Date.now() + Math.random()) Tests: updated blob.test.ts for changed fallback behavior and 4KB threshold; added new test case for small-blob inline retention. All 39 tests pass.
…nt bulkCreate non-atomicity
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes (post PR #3 merge)
Bug fixes (from devil's advocate review)
replace()now processes blobs — previously skippedprocessForUpload, unlikecreate()list()sequential blob processing — prevents unbounded parallel downloads (was N×6 concurrent)bulkCreateparallel + documented non-atomicity —Promise.allwith clear JSDoc warning1:${blobId}toUint8Arraywidened to handle all TypedArrays + DataView correctlycrypto.getRandomValues()CI
Tests
39 unit tests: blob (15), data (11), auth (6), client (7)