Skip to content

Editorial Notes: Notes can be attached to stale block client IDs when the editor changes mid-request #1174

Closed

Description

@yogeshbhutkar

Description

Similar to #1138

Editorial Notes holds on to a block's client ID from the moment a request starts. If the editor changes while that request is in flight, the client ID can go stale, and the note ends up attached to a block that no longer exists.

Toggling "Show Template" mid-request
The note is generated successfully, but it shows the original block as deleted. Toggling template mode rebuilds the block tree and gives every block a new client ID, so the ID the request started with no longer matches anything.

Deleting a block mid-request
If a block is removed from the canvas while its request is in flight, the request is wasted and the note is attached to a block that doesn't exist.

For useEditorialNotes.ts, this happens because the corresponding createNote helper may use a stale block.clientId here:

dispatch( blockEditorStore ).updateBlockAttributes( block.clientId, {
metadata: { ...existingMeta, noteId: note.id },
} );
}

Note: The shared helper at #1137 needs to be merged first to be utilized in fixing this.

Step-by-step reproduction instructions

  1. Enable the Editorial Notes experiment.
  2. Open a post with several paragraph blocks.
  3. Click Generate Editorial Notes.
  4. While "Reviewing blocks…" is still showing, toggle Show template.
  5. Wait for the request to finish.
  6. Open the Notes sidebar.
  7. The new note shows its original block as deleted.

Screenshots, screen recording, code snippet

editorial.notes.mov

Environment info

  • WordPress Version: Latest Trunk
  • AI Plugin Version: Latest Develop

Please confirm that you have searched existing issues in the repo.

  • Yes

Please confirm that you have tested with all plugins deactivated except the AI plugin.

  • Yes

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Activity

  1. added
    [Type] Bug
    on Oct 14, 2026
  2. yogeshbhutkar commented on Oct 14, 2026

    @yogeshbhutkar
    ContributorAuthor

    I can take this up after #1137 gets merged so that the shared helper is re-used.

  3. jeffpaul commented on Oct 28, 2026

    @jeffpaul
    Member

    @yogeshbhutkar note that 1137 has been merged

  4. added theissue type on Oct 28, 2026
  5. added this to the 1.6.0 milestone on Oct 28, 2026
  6. moved this from Triage to To do in WordPress AI Roadmapon Oct 28, 2026
  7. yogeshbhutkar commented on Nov 10, 2026

    @yogeshbhutkar
    ContributorAuthor

    This issue is still on my radar, and am fixing dependencies (#1222, #1340) first before picking this up.

  8. moved this from To do to In progress in WordPress AI Roadmapon Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

[Type] Bug

Type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions