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

ySyncPlugin ignores addToHistory:false meta of appendedTransaction #141

Open
romansp opened this issue Sep 13, 2023 · 0 comments · May be fixed by #142
Open

ySyncPlugin ignores addToHistory:false meta of appendedTransaction #141

romansp opened this issue Sep 13, 2023 · 0 comments · May be fixed by #142
Assignees
Labels
bug Something isn't working

Comments

@romansp
Copy link

romansp commented Sep 13, 2023

Describe the bug
ySyncPlugin ignores addToHistory: false of appendedTransaction thus root transaction gets added onto undo/redo stack.

To Reproduce
Steps to reproduce the behavior:

  1. Clone fork with a test repro: https://github.com/romansp/y-prosemirror/tree/appendedTransaction-addToHistory-false
  2. Checkout the commit before the fix
  3. Run npm run test
  4. See that test named add to history ignore with append transaction plugin has failed

Expected behavior
addToHistory: false should be respected if it comes from appendedTransaction. Root transaction should not appear on the undo/redo stack, and undoing/redoing should not have any affect.

Actual behavior
Transaction is added onto undo stack.

Environment Information

  • Browser, Microsoft Edge 116.0.1938.76 (Official build) (arm64)
  • y-prosemirror v1.2.1
  • yjs v13.6.7

Additional context
Original prosemirror-history plugin does indeed check appendedTransaction and inspects for possible addToHistory: false as demonstrated here https://github.com/ProseMirror/prosemirror-history/blob/40d274a74d0fc0787aeca03634a64d0c78f18a50/src/history.ts#L277C15-L277C15

@romansp romansp added the bug Something isn't working label Sep 13, 2023
romansp added a commit to romansp/y-prosemirror that referenced this issue Sep 13, 2023
… to prevent transaction from appearing on undo stack. fixes yjs#141
erwamartin pushed a commit to secondlayerco/y-prosemirror that referenced this issue Dec 11, 2023
… to prevent transaction from appearing on undo stack. fixes yjs#141
erwamartin pushed a commit to secondlayerco/y-prosemirror that referenced this issue Dec 11, 2023
… to prevent transaction from appearing on undo stack. fixes yjs#141
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants