Fix sync server#3463
Merged
Merged
Conversation
Signed-off-by: Herklos <herklos@drakkar.software>
Signed-off-by: Herklos <herklos@drakkar.software>
GuillaumeDSM
approved these changes
May 16, 2026
Default sync collections now use encryption=delegated so the protocol
bridge in octobot_sync.server is the sole encryption layer. With
encryption=identity, EncryptedObjectStore wrapped the bridge and tried
to AES-GCM-decrypt the bridge's wallet-PK ciphertext with an unrelated
HKDF key — InvalidTag.
to_protocol_automations_state now skips tasks that fail to parse
instead of bubbling the exception. One malformed task no longer kills
the entire /pull/users/{addr}/data response. Skipped tasks are logged
with content_metadata and a content preview for diagnosis.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
starfish_server.protocol.pull expects raw store output to be a
StoredDocument-shaped JSON ({"v","data","timestamps","hash"}), but
octobot_sync.server returned the wallet-encrypted blob directly,
producing a KeyError: 'v' on every pull.
server.get_data now wraps its output via _wrap_as_stored_document; the
hash is sha256(plaintext) so it stays stable across pulls (AES-GCM uses
a random nonce, so hashing the ciphertext would change every call and
break ETag/304 caching). server.put_data unwraps incoming bodies via
_unwrap_stored_document_data before decrypting.
The hash helper lives in octobot_sync.crypto as sha256_hex.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Default `generate:typescript` now emits a lightweight `schema.d.ts` via openapi-typescript. The previous openapi-generator-cli flow remains available as `generate:typescript:java` for callers that still need the full typed-fetch client, and the npm package identity is moved to `@drakkar.software/octobot-protocol` so the two variants don't collide on the same scope. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Module-level `logger` in packages/node/octobot_node/protocol/automations.py matches the surrounding packages/node convention (scheduler/workflows_util.py, scheduler/api.py, scheduler/task_context.py all bind `logger` at module load) instead of the lazy `_get_logger()` factory pattern that lives in packages/sync. octobot_sync.server._wrap_as_stored_document now reuses starfish_server.protocol.types.DOCUMENT_VERSION for the wire `v` field instead of a magic literal. Collections without an explicit protocol-bridge case (everything except user-data, user-accounts, user-actions — so user-settings, user-strategies, and anything added later) now fall through to opaque filesystem storage in user/sync/data. Server persists the client ciphertext as-is on push and returns it verbatim on pull; wallet-key decryption stays entirely on the client. Replaces the previous "unsupported collection" error log. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comment on lines
+10
to
+11
| "generate:typescript": "openapi-typescript openapi.json -o octobot_protocol_ts/schema.d.ts", | ||
| "generate:typescript:java": "node scripts/clean-protocol-codegen-output.mjs typescript && openapi-generator-cli generate -i openapi.json -g typescript-fetch -o octobot_protocol_ts --global-property models --additional-properties supportsES6=true,typescriptThreePlus=true,npmName=@drakkar.software/octobot-protocol,npmVersion=0.1.0,useOneOfDiscriminatorLookup=true", |
Member
There was a problem hiding this comment.
why do we need 2 commands for generate:typescript?
Switches `generate:typescript` back to the Java-based openapi-generator-cli, but uses the plain `typescript` generator instead of `typescript-fetch` so no fetch client / runtime is emitted — only model interfaces. Drops the `typescript-fetch`-specific `typescriptThreePlus` flag and removes the short-lived `openapi-typescript` JS path along with its lockfile entries. The clean-codegen script now preserves the hand-written npm wrapper files (`package.json`, `index.js`, `index.d.ts`) under `octobot_protocol_ts/` so they survive the pre-codegen wipe. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
No description provided.