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: updating tp content from empty to value doesn't create the tp instance #139

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

MichalK6677
Copy link

@MichalK6677 MichalK6677 commented Jun 9, 2023

fix: updating tp content from empty to value doesn't create the tp instance)

Fixes #138

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines: CONTRIBUTING.md#commit
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

#138

What is the new behavior?

The solution here is to create/destroy the instance depending on the content changes as well and not just on initialization.

Does this PR introduce a breaking change?

[ ] Yes
[x ] No

Other information

@stackblitz
Copy link

stackblitz bot commented Jun 9, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Contributor

@shaharkazaz shaharkazaz left a comment

Choose a reason for hiding this comment

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

Left a couple of comments, please add specs for this case as well 👍

Comment on lines +141 to +142
if (!changes.content.previousValue && changes.content.currentValue) {
this.initInstanceCreation();
Copy link
Contributor

Choose a reason for hiding this comment

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

There is a situation where we might subscribe several times to the events.
Let's say I'm starting with no content, then adding content. I'm subscribed twice no?
I think the creation trigger should be uncoupled from the instance existence. If we already decided to create an instance, we should always create it here and not resubscribe to the events.

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.

Updating tp content from empty to value doesn't create the tp instance
2 participants