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

Add consecutive redos test case #1

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

felipe-augusto
Copy link

@felipe-augusto felipe-augusto commented Jun 14, 2024

Add consecutive redos test case

@@ -216,6 +216,10 @@ export class AutomergeRepoUndoRedo<T> {
});

if (heads) {
if (stack.redos.length > 0) {
Copy link
Author

Choose a reason for hiding this comment

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

this fixes the can apply consecutive redos on untracked text test and it does makes sense in my head I guess

@@ -174,7 +174,7 @@ export class AutomergeRepoUndoRedo<T> {
heads,
);

change.redo.patches = unpatchAll(before, patches);
// change.redo.patches = unpatchAll(before, patches);
Copy link
Author

Choose a reason for hiding this comment

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

this one fixes the can apply redos and undos but at the same time it breaks the local undo + global redo test

@acurrieclark
Copy link
Member

Can you just clarify what you are hoping to test for here? Is the idea that you have 2 peers, one makes changes, then the other. You then undo twice on the first peer, and then redo twice and would expect to return to the same value?

@felipe-augusto
Copy link
Author

@acurrieclark yes, I think that is the expected behavior, isn't it?

@acurrieclark
Copy link
Member

It is, absolutely! I was just trying to work out if the test makes changes in the way I expected. I'll take a look and let you know.

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants