Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

Fix bug in context consumers #320

Merged
merged 4 commits into from
Sep 21, 2021
Merged

Fix bug in context consumers #320

merged 4 commits into from
Sep 21, 2021

Conversation

oltrep
Copy link
Contributor

@oltrep oltrep commented Sep 16, 2021

Closes #319.

PR #315 uncovered that willUnmount can be called more than once in certain cases. This PR adds a test that demonstrate the problem and fixes it.

Checklist before submitting:

  • Added entry to CHANGELOG.md
  • Added/updated relevant tests
  • Added/updated documentation

@coveralls
Copy link

Coverage Status

Coverage increased (+0.004%) to 94.779% when pulling ae8edf0 on oltrep:fix-issue-319 into 97a30b3 on Roblox:master.

@github-actions
Copy link

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@ZoteTheMighty
Copy link
Contributor

Is this problem related to something else going on with the component lifecycle, or is it unique to context?

@oltrep
Copy link
Contributor Author

oltrep commented Sep 17, 2021

Is this problem related to something else going on with the component lifecycle, or is it unique to context?

The error comes specifically from context in this case, but the root cause is that willUnmount can be called twice on an element. The test case was adapted from a test from #315 which showed that behavior

@oltrep oltrep merged commit a3adfa6 into Roblox:master Sep 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error Listeners can only be disconnected once in context consumers
4 participants