Skip to content

SD-3352 - fix: refine deletion behavior for anonymous users in overlap-compiler#3655

Open
chittolinag wants to merge 4 commits into
mainfrom
gabriel/sd-3352-bug-same-author-delete-inside-pending-insertion-should
Open

SD-3352 - fix: refine deletion behavior for anonymous users in overlap-compiler#3655
chittolinag wants to merge 4 commits into
mainfrom
gabriel/sd-3352-bug-same-author-delete-inside-pending-insertion-should

Conversation

@chittolinag
Copy link
Copy Markdown
Contributor

@chittolinag chittolinag commented Jun 5, 2026

Issue

In suggesting mode, deleting part of your own pending insertion should simply shrink the
suggestion - the way Word handles it. Instead, SuperDoc stacked a tracked deletion on top of your own insertion, as if another reviewer had crossed out your text: two overlapping review items for one intent.

This only happened in sessions without an identified user (no user id/email passed by the
integrator). The editor handled differently each action: typing into your insertion used a permissive author check that recognizes an anonymous session as itself, but deleting inside it used the strict identity check. So the same user was "you" while typing and "someone else" the moment they deleted.

Repro

Comment out this line from SuperdocDev.vue to simulate the default user.

Screenshot 2026-06-05 at 16 16 15

Proposed solution

Make deletion answer "is this my insertion?" exactly the way typing already does - one shared rule
(isSameUserForRefinement in overlap-compiler.js) for all same-user refinement: typing into,
backspacing through, and now deleting inside your own pending insertion.

User-visible result: deleting inside your own suggestion shrinks it in place (deleting all of it
removes the suggestion entirely), with or without an identified user.

Review protection is untouched: other authors' suggestions - including named authors from imported Word files - still produce an independent, reviewable deletion, and accept/reject decisions still require strong identity.

@chittolinag chittolinag requested a review from a team as a code owner June 5, 2026 15:09
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Jun 5, 2026

SD-3352

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@chittolinag chittolinag marked this pull request as draft June 5, 2026 15:36
@chittolinag chittolinag marked this pull request as ready for review June 5, 2026 18:11
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 326e79eab1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants