-
Notifications
You must be signed in to change notification settings - Fork 1
JS Server: Implemented snapshot, verify, maintenance, update blobs #278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
Member
|
In the future there is not a real need to update this specifically since the jenkins job will fill in the version it wants when it runs jobs. |
borrrden
reviewed
Oct 24, 2025
servers/javascript/src/snapshot.ts
Outdated
| for (const updates of update.updatedProperties) { | ||
| for (const key of Object.getOwnPropertyNames(updates)) { | ||
| if (!KeyPathCache.path(key).write(doc, updates[key])) { | ||
| //??? |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Failure to write? Should be some kind of 500 level error right?
borrrden
reviewed
Oct 24, 2025
Also updated CBL dependency to 1.0.0-5
i.e. convert `_default._default` to `_default`
6296fad to
9d8028f
Compare
1. Make it an error to have a snapshot update to a document that doesn't exist in a snapshot 2. Only return result.document if the snapshot update type is an update (not delete or purge) 3. Sometimes we make a snapshot of a document that does not exist in the DB in order to verify that it didn't get pulled unintentionally, so check that (it will show up as an entry with an "undefined" value) 4. updateDatabase should be allowed to create documents 5. Bug in update remove properties handling (it was iterating the actual strings and sending them one character at a time)
Redocly preview |
Updating a blob would trigger an exception because it's illegal to make non-database async calls within a transaction. So use Collection.updateMultiple() instead. NOTE: This assumes that a /updateDatabase request does not list the same document multiple times! If so, this will probably fail.
1. Normalize collection name in replicator config 2. Correct blob base URL
Only update verifications (not delete or purge) return the document. Also, there is a distinction between null and missing for snapshot entries: null means "I want to verify this later, but it doesn't exist right now". undefined is "Not included in the snapshot and ineligible for verification"
- Spurious `!` on line 40 messes up the test for undefined - I accidentally used `!!` (Kotlin syntax) instead of `!` on line 59 - Using `T | null` in DocumentMap is incorrect; nulls are handled in the declaration of #documents, which is `DocumentMap<cbl.CBLDocument | null>`.
The TDK expects an HTTP 400 when a nonexistent blob is requested. Remove "self" from error message since it results in it being printed twice, and make the error message "returned XXX" not weirdly formatted.
Needs two empty collections to be compatible with SGW's setup
The cert is now issued by a CA that can easily be trusted in python, as well as browser. Existing SDK cert pinning should still be fine as well. Also only copy prerelease RPM if it's not already on the remote machine (uploads are slow)
Their functions are different signatures so a premade CreateFilter is not possible
borrrden
approved these changes
Oct 29, 2025
Since JS has no access to that information :(
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.
Also updated CBL dependency to 1.0.0-5