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

feat(debug): Expose yjs debug function in editor API #6598

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mejo-
Copy link
Member

@mejo- mejo- commented Nov 4, 2024

Should make it easier to debug sync issues.

Screenshot

Screenshot
2024-11-04T16:30:16,061786243+01:00

🏁 Checklist

  • Code is properly formatted (npm run lint / npm run stylelint / composer run cs:check)
  • Sign-off message is added to all commits

Should make it easier to debug sync issues.

Signed-off-by: Jonas <[email protected]>
/**
* Helper method to debug yjs issues
*/
debugYjs() {
Copy link
Member

Choose a reason for hiding this comment

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

Do we have this somewhat accessible when text open in viewer so we can also ask people editing to dump the output when editing outside of collectives?

Copy link
Member Author

Choose a reason for hiding this comment

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

Well, it's a bit complicated to expose this, as we don't know how many editor instances are instantiated in the browser. We could create an array OCA.Text.editors and add each editor along with the debugYjs function as a new item. This should probably be done in Editor.vue, as all editors that use a session and Yjs are created from here to my knowledge. I don't see any value in exposing the non-session editors from MarkdownContentEditor.vue and BaseReader.vue. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

Having an array of editors sounds reasonable. We can add the filename maybe to the debug output so that the individual ones can be identified (e.g. a readme is open and a viewer instance).

I think we don't need to make it too complex, as long as we can somehow get the information and identify the relevant instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review enhancement New feature or request
Projects
Status: 👀 In review
Development

Successfully merging this pull request may close these issues.

2 participants