Conversation
…r DO migration Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
Commits
|
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.
Problem
When a user drags and drops an image in the DA editor, the upload is a two-step process:
If the user clicks Preview or Publish before that debounced save completes, the Cloudflare Durable Object (DO) backing the collab session may have migrated to a different machine in the meantime. The result: the preview/publish pipeline reads the old version of the document from da-admin — without the newly dropped image.
Solution
Before triggering a Preview or Publish action, the client now sends a WebSocket flush request (
MSG_FLUSH_REQUEST = 2) to da-collab, asking it to immediately flush any pending in-memory changes to da-admin. The client then:MSG_FLUSH_RESPONSE = 3.Changes
blocks/edit/prose/index.js— addsforceSave(provider)(exported) and its helpers (decodeFlushAck,sendFlushRequest,waitForWsConnection). AttachesdaContent.forceSaveat the end ofinitProse.blocks/edit/da-title/da-title.js— callsdaContent.forceSave()inhandleActionbeforesaveToAem, only for the prose edit view.test/unit/blocks/edit/prose/index.test.js— adds 4forceSaveunit tests covering: successful ack, server-reported failure, disconnected-then-reconnected provider, and filtering of unrelated WebSocket message types.Test plan
Test page: https://flushsave--da-live--adobe.aem.live/
npm test— 1355 passed, 0 failed)npm run lintpasses with no errors🤖 Generated with Claude Code