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

[stable24] Trigger event on content change in syncservice #2679

Merged
merged 4 commits into from
Jul 6, 2022

Conversation

mejo-
Copy link
Member

@mejo- mejo- commented Jul 6, 2022

Manual backport of #2465

Summary

Fires 4 events from SyncService

  • sync-service:idle
  • sync-service:save
  • sync-service:error
  • sync-service:sync

Prevention of Memory Leak

All SyncService event handlers are storage in arrays, and never removed from these arrays.
Although the SyncService whore removed from Vue component context, we had a circular reference here.
This is a very common scenario for Memory Leak in JavaScript.

Now using mitt library is possible to use .off to remove an event handler.

To do it, I've change part of event contracts (error event) and I've split the event handlers in component methods.

There are more potential problems to solve, but we can do it later.

Copy link
Collaborator

@max-nextcloud max-nextcloud left a comment

Choose a reason for hiding this comment

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

yes... i guess would be good to bring this back to stable24

@mejo- mejo- merged commit 2f7771c into stable24 Jul 6, 2022
@delete-merged-branch delete-merged-branch bot deleted the backport/2465/stable24 branch July 6, 2022 12:01
@blizzz blizzz mentioned this pull request Jul 6, 2022
18 tasks
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