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

[BUG] [Angular] Not removing enable when switch to disabled #1116

Closed
UnleashSpirit opened this issue Jan 3, 2025 · 7 comments
Closed

[BUG] [Angular] Not removing enable when switch to disabled #1116

UnleashSpirit opened this issue Jan 3, 2025 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@UnleashSpirit
Copy link

UnleashSpirit commented Jan 3, 2025

Observed behavior

Hi, we just testing some Openfeature with our Angular 16+ apps
We test the exemple from here https://openfeature.dev/docs/reference/technologies/client/web/angular#boolean-feature-flag
A simple copy/paste, we also use flagd as provider, everything seems to works (connection, event, etc...)

The problem we have is that when we sitch from "on" to "off" the "on message" does not disapear.
We se the "initializing" then it's replaced by the "enable" but when we disable the feature we got this
Image

Expected Behavior

Only the disabled message to be print

Steps to reproduce

   "@angular/core": "^16.2.12",
    "@openfeature/angular-sdk": "^0.0.9-experimental",
    "@openfeature/flagd-web-provider": "^0.7.2",
    "@openfeature/web-sdk": "^1.4.0",

In a basic component use the exemple code in the doc

<div
  *booleanFeatureFlag="'isFeatureEnabled'; default: true; domain: 'userDomain'; else: booleanFeatureElse; initializing: booleanFeatureInitializing; reconciling: booleanFeatureReconciling">
  This is shown when the feature flag is enabled.
</div>
<ng-template #booleanFeatureElse>
  This is shown when the feature flag is disabled.
</ng-template>
<ng-template #booleanFeatureInitializing>
  This is shown when the feature flag is initializing.
</ng-template>
<ng-template #booleanFeatureReconciling>
  This is shown when the feature flag is reconciling.
</ng-template>

In the flagd switch from "defaultVariant": "on" to "defaultVariant": "off" and we have the two messages (as shown above)

@UnleashSpirit UnleashSpirit added the bug Something isn't working label Jan 3, 2025
@beeme1mr
Copy link
Member

beeme1mr commented Jan 3, 2025

Hey @lukas-reining, would you mind looking at this when you have a moment?

@lukas-reining
Copy link
Member

lukas-reining commented Jan 3, 2025

Hey, @UnleashSpirit, thanks for reporting this!
I will have a look at this now!

@lukas-reining
Copy link
Member

Hey @UnleashSpirit, I had a look into the issue and I have trouble replicating it.
Are you able to reproduce it in a very basic setup?

I added a simple flag change test using exactly the same HTML as the example to the Angular Test App that I used for showing the features of the Angular SDK.
The only difference I can spot is that this is not using flagd but the InMemoryProvider.

I also created an Angular 16 branch there, this does not have the issue you described too. Can you please also test this code on your side? https://github.com/open-feature/angular-test-app/tree/example/test-angular-16

If my demo App is working for you I would be happy if you could supply me with some more code that has the issue.

Thank you!

@UnleashSpirit
Copy link
Author

Hi, thanks for the quick response.
It's a company app we just upgrade from 14 to 16. If you do not replicate, it's probably our app.
I'll try to do more test back to work :)

@lukas-reining
Copy link
Member

lukas-reining commented Jan 3, 2025

It's a company app we just upgrade from 14 to 16. If you do not replicate, it's probably our app.

Okay, would be happy about feedback once you find it out or have additional information!

I'll try to do more test back to work :)

Thanks @UnleashSpirit ! :)

@UnleashSpirit
Copy link
Author

UnleashSpirit commented Jan 6, 2025

Hi, I test it from scratch with a Angular@16 apps and everythings works like a charm

So this is our application, but now I need to understand why. As it's a huge application, it will take time (especially since this openfeature is a poc so no priority)

Sorry for the fake bug :(

@lukas-reining
Copy link
Member

lukas-reining commented Jan 6, 2025

Hi, I test it from scratch with a Angular@16 apps and everythings works like a charm

So this is our application, but now I need to understand why. As it's a huge application, it will take time (especially since this openfeature is a poc so no priority)

Okay, if there is a part of the App that you can share where you use it, feel free to provide me with the snippet to see if I can find anything @UnleashSpirit. You can also find me on the CNCF slack if you want.

Otherwise feel free to come back if it turns out the SDK has anything todo with your problem, maybe it is a very special case.

Will close this then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants