Skip to content

fix: live-array delete sync should not clear the set on length match#8927

Merged
runspired merged 3 commits intomainfrom
main-unload-all
Sep 28, 2023
Merged

fix: live-array delete sync should not clear the set on length match#8927
runspired merged 3 commits intomainfrom
main-unload-all

Conversation

@runspired
Copy link
Contributor

@runspired runspired commented Sep 27, 2023

test from #8926
resolves #8924

adds test for unloadAll not fully cleaning up

The rough issue is that if all records are removed and the same number re-added before the array has synced we were then fully clearing membership which would make the next sync after this fail to work properly.

e.g.

arr.length; // 2
arrSet.size; // 2
<add> C
<add> D
<rem> A
<rem> B

if (rem.length === arr.length) { arrSet.clear() }

arr.length; // 2
arrSet.size; // 0

@runspired runspired added 🎯 canary PR is targeting canary (default) 🏷️ bug This PR primarily fixes a reported issue labels Sep 27, 2023
@runspired runspired changed the title fix: add test for unloadAll not fully cleaning up fix: live-array delete sync should not clear the set on length match Sep 28, 2023
@runspired runspired merged commit d8f5fd7 into main Sep 28, 2023
@delete-merged-branch delete-merged-branch bot deleted the main-unload-all branch September 28, 2023 04:58
@runspired runspired added 🎯 release PR should be backported to release 🎯 lts The PR should be backported to the most recent LTS labels Sep 28, 2023
runspired added a commit that referenced this pull request Sep 28, 2023
…8927)

* fix: add test for unloadAll not fully cleaning up

* fix

* fix lint
runspired added a commit that referenced this pull request Sep 28, 2023
…8927)

* fix: add test for unloadAll not fully cleaning up

* fix

* fix lint
runspired added a commit that referenced this pull request Sep 28, 2023
…8927) (#8926)

* fix: add test for unloadAll not fully cleaning up

* fix

* fix lint
runspired added a commit that referenced this pull request Sep 28, 2023
…8927) (#8929)

* fix: add test for unloadAll not fully cleaning up

* fix

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

Labels

🎯 canary PR is targeting canary (default) 🎯 lts The PR should be backported to the most recent LTS 🎯 release PR should be backported to release 🏷️ bug This PR primarily fixes a reported issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[4.12.3] Bug: Loading / unloading the same resource multiple times results in lingering reference in cache

1 participant