Skip to content

Conversation

@mejo-
Copy link
Member

@mejo- mejo- commented Dec 6, 2022

📝 Summary

Our Tiptap heading extension registers a debounced extractHeadings function for onUpdate. If the editor gets removed but a debounced extractHeadings call is still pending, this leads to errors (which sometimes break tests).

So let's track whether the editor is still alive and only call debounced extractHeadings in this case.

🏁 Checklist

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

@mejo- mejo- added tests If you write them we ♥ you 3. to review labels Dec 6, 2022
Copy link
Member

@juliusknorr juliusknorr left a comment

Choose a reason for hiding this comment

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

Makes sense 👍

mejo- added 2 commits December 6, 2022 13:09
Our Tiptap heading extension registers a debounced extractHeadings
function for onUpdate. If the editor gets removed but a debounced
extractHeadings call is still pending, this leads to errors (which
sometimes break tests).

So let's check whether the editor is still alive and only call
debounced extractHeadings in this case.

Signed-off-by: Jonas <[email protected]>
@cypress
Copy link

cypress bot commented Dec 6, 2022



Test summary

109 0 0 0Flakiness 2


Run details

Project Text
Status Passed
Commit be64c43
Started Dec 6, 2022 1:04 PM
Ended Dec 6, 2022 1:10 PM
Duration 06:21 💡
OS Linux Ubuntu -
Browser Electron 106

View run in Cypress Dashboard ➡️


Flakiness

workspace.spec.js Flakiness
1 Workspace > formats text
sections.spec.js Flakiness
1 Content Sections > Heading anchors > Anchor scrolls into view

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@mejo- mejo- force-pushed the fix/dangling_debounce branch from 57a1fb4 to 3ba143d Compare December 6, 2022 12:09
@mejo-
Copy link
Member Author

mejo- commented Dec 6, 2022

/compile

Signed-off-by: nextcloud-command <[email protected]>
@max-nextcloud
Copy link
Collaborator

I wonder if this also applies to the other debounced functions we have. But then that's a different step / fix i guess.

@max-nextcloud
Copy link
Collaborator

/backport 72a1c48 to stable25

@mejo- mejo- merged commit eb44337 into master Dec 6, 2022
@delete-merged-branch delete-merged-branch bot deleted the fix/dangling_debounce branch December 6, 2022 13:12
@mejo-
Copy link
Member Author

mejo- commented Dec 6, 2022

/backport 72a1c48 to stable25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review tests If you write them we ♥ you

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants