Skip to content

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.

3 participants