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

Initializing the table of contents creates a transaction even in read only mode #5861

Closed
max-nextcloud opened this issue Jun 6, 2024 · 3 comments · Fixed by #5893
Closed
Assignees
Labels
bug Something isn't working

Comments

@max-nextcloud
Copy link
Collaborator

Describe the bug

  1. Document opens
  2. Table of contents is initialized
  3. Headings are parsed and get an id
  4. ids are added to heading nodes creating a transaction
  5. transaction updates document state leading to steps pushed even in read only mode.

To Reproduce

Steps to reproduce the behavior:

  1. Create a markdown file with headings and a public read only share of it
  2. observe network traffic
  3. Notice step send in one of the push requests

Expected behavior
Opening the document read only should not alter the state.

Screenshots
will attach later

@max-nextcloud max-nextcloud added the bug Something isn't working label Jun 6, 2024
@max-nextcloud max-nextcloud self-assigned this Jun 6, 2024
@github-project-automation github-project-automation bot moved this to 🧭 Planning evaluation (don't pick) in 📝 Office team Jun 6, 2024
@max-nextcloud max-nextcloud moved this from 🧭 Planning evaluation (don't pick) to 📄 To do (~10 entries) in 📝 Office team Jun 6, 2024
@max-nextcloud
Copy link
Collaborator Author

This is related to #5800 (comment)

@mejo-
Copy link
Member

mejo- commented Jun 10, 2024

Probably the way forward would be to migrate extractHeadings() to use ProseMirror Decorations for setting the id attribute locally, instead of altering the document state. See this example.

@juliusknorr
Copy link
Member

Ah sounds like a good idea, haven't thought of that with my comment in #5800 (comment)

@max-nextcloud max-nextcloud moved this from 📄 To do (~10 entries) to 🏗️ In progress in 📝 Office team Jun 11, 2024
max-nextcloud added a commit that referenced this issue Jun 12, 2024
This avoids transactions that actually change the document state.

Fixes #5861.
Fixes #5800.

Signed-off-by: Max <[email protected]>
max-nextcloud added a commit that referenced this issue Jun 13, 2024
This avoids transactions that actually change the document state.

Fixes #5861.

Signed-off-by: Max <[email protected]>
max-nextcloud added a commit that referenced this issue Jun 17, 2024
This avoids transactions that actually change the document state.

Fixes #5861.

Signed-off-by: Max <[email protected]>
max-nextcloud added a commit that referenced this issue Jun 17, 2024
This avoids transactions that actually change the document state.

Fixes #5861.

Signed-off-by: Max <[email protected]>
max-nextcloud added a commit that referenced this issue Jun 18, 2024
This avoids transactions that actually change the document state.

Fixes #5861.

Signed-off-by: Max <[email protected]>
max-nextcloud added a commit that referenced this issue Jun 18, 2024
This avoids transactions that actually change the document state.

Fixes #5861.

Signed-off-by: Max <[email protected]>
mejo- pushed a commit that referenced this issue Jul 23, 2024
This avoids transactions that actually change the document state.

Fixes #5861.

Signed-off-by: Max <[email protected]>
max-nextcloud added a commit that referenced this issue Jul 24, 2024
This avoids transactions that actually change the document state.

Fixes #5861.

Signed-off-by: Max <[email protected]>
mejo- pushed a commit that referenced this issue Jul 25, 2024
This avoids transactions that actually change the document state.

Fixes #5861.

Signed-off-by: Max <[email protected]>
@github-project-automation github-project-automation bot moved this from 🏗️ In progress to ☑️ Done in 📝 Office team Jul 25, 2024
mejo- pushed a commit that referenced this issue Jul 25, 2024
This avoids transactions that actually change the document state.

Fixes #5861.

Signed-off-by: Max <[email protected]>
mejo- pushed a commit that referenced this issue Jul 25, 2024
This avoids transactions that actually change the document state.

Fixes #5861.

Signed-off-by: Max <[email protected]>
mejo- pushed a commit that referenced this issue Jul 29, 2024
This avoids transactions that actually change the document state.

Fixes #5861.

Signed-off-by: Max <[email protected]>
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
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants