Skip to content
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

Intervals not at expected location sometimes after undo-ing #19352

Open
amruth-ms opened this issue Jan 26, 2024 · 3 comments
Open

Intervals not at expected location sometimes after undo-ing #19352

amruth-ms opened this issue Jan 26, 2024 · 3 comments
Assignees
Labels
bug Something isn't working community-contribution

Comments

@amruth-ms
Copy link

Describe the bug

With the latest changes in this file(https://github.com/microsoft/FluidFramework/blob/main/packages/dds/sequence/src/revertibles.ts), the undo/redo with intervals is more flexible now. But there are a few instances where after undo-ing the intervals don't seem to be repositioned at the expected location. Below are the repro steps for one such case:

To Reproduce

Steps to reproduce the behavior:

  1. Type 9 characters. In this example, let’s say the user typed “123456789”
  2. Insert an interval with the same start and end positions of offset 2(after character “2”).
  3. Delete characters from offset 2 to 4(characters “3” and “4”).
  4. Now trigger undo.
  5. Observe that the interval is at the expected location at offset 2(after character “2”).
  6. Now delete the character at offset 4(the character “5”). The text should now be “12346789”.
  7. Now trigger undo.
  8. Observe that the interval is now at offset 4(after character “4”) instead of being at offset 2(after character “2”).
@amruth-ms amruth-ms added the bug Something isn't working label Jan 26, 2024
@scarlettjlee
Copy link
Contributor

We're looking into this and will update when we have more info.

jzaffiro added a commit that referenced this issue Mar 14, 2024
…20026)

During the interval change codepath, many local references are created
and updated, but local references for removed interval endpoints were
never cleaned up. This was causing a bug where after removing a range of
text and reverting the remove, the interval endpoints would not return
to the position at which they were created. Some existing unit tests
also used the stale references, and these only worked in the past
because we didn't do any clean up. Those tests now use the updated
references.


[AB#7044](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/7044),
#19352

---------

Co-authored-by: Scarlett Lee <90647596+scarlettjlee@users.noreply.github.com>
@jzaffiro
Copy link
Contributor

@amruth-ms after the above PR was checked in, are you seeing the expected behavior after you undo intervals? We kept around some references that were interfering with the repositioning of the interval after the undo. The case you described should work correctly now.

@amruth-ms
Copy link
Author

@jzaffiro thank you for the update :). It looks like the changes in the above commit did not reach our repo yet. I will verify if the bug is fixed on our end once we update our FF versions and give you an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community-contribution
Projects
None yet
Development

No branches or pull requests

3 participants