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

fix: code deletion when switching between multiple instances #81

Merged
merged 15 commits into from
Jan 4, 2024

Conversation

MrSurana
Copy link
Collaborator

@MrSurana MrSurana commented Dec 26, 2023

The function _handleInitialRevisions() inside firebase-adapter.ts was not ceasing operation when the dispose() method was called. Because the this._zombie flag was set to true only once Ready event was triggered. But since this is the first method that is supposed to initialise the text and then trigger the Ready event, the operation in this method would continue executing even if firepad is disposed.

To prevent this, the this._zombie variable can be used to declare that firepad is now disposed even before triggering the Ready event.


This discrepancy has always been there in the code since the migration to typescript. Here is the actual firepad implementation of dispose, note that the _handleInitialRevisions method reset is missing from our fork.

https://github.com/FirebaseExtended/firepad/blob/master/lib/firebase-adapter.js#L70

@MrSurana MrSurana marked this pull request as ready for review December 29, 2023 06:21
package.json Outdated Show resolved Hide resolved
@MrSurana MrSurana merged commit d52319f into main Jan 4, 2024
1 check passed
@MrSurana MrSurana deleted the fix/code-deletion branch January 4, 2024 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants