Comments (8)
Hi @sevikarakose - we'll take a look at this.
from flagsmith-dotnet-client.
@sevikarakose Hi, can I just double check, you are only creating configuration and initialising an instance of BulletTrainClient once in your Web API right? When you say run on the web api the 2nd time, you mean you fully terminate your api and re-start it?
from flagsmith-dotnet-client.
Hi there, thanks for the quick reply. I do not terminate my api and restart it. I call my method that goes to the BulletTrain api and check it the second time, while the app is still running.
Actually I was doing a POC with the Bullet Train's dotnet client for my company, so I created a sample api and saw it worked with (let's say) feature flag on. Then without restarting it, I went to the BulletTrain front end (running in Docker) changed the flag value and but this time, I got the error that I pasted.
So to double check, I restarted my api, got the flag result from the BulletTrain api the first time again successfully (whatever the result is), but then I did not change the flag's value from BulletTrain front end, yet again the api failed.
So to triple check :), I created a Console App, and after seeing it's working properly, I put my method in a loop for 1000 times to go check the value from the BulletTrain api. While it was working successfully, I went to the BulletTrain frontend and changed the value for a few times. It never failed, always got the proper results.
from flagsmith-dotnet-client.
Ok thanks @sevikarakose thats really useful. Seems as though any testing with a Console App is not going to be useful in this case. I've not been able to replicate the error you're seeing in the Console app. Would it be possible for you to send across the PoC Web API you've been working on?
from flagsmith-dotnet-client.
Hi there! Thanks again for your fast response. You can clone this repository to check it out!
https://github.com/sevikarakose/Glossary
Before running it, you will need to change the env key for BulletTrain api. The feature I check is called, "show_feature"
When it's up and running, just go to one of these url's for two or more times to see the problem
http://localhost:5000/api/glossary
https://localhost:5001/api/glossary
from flagsmith-dotnet-client.
Thanks for that! I replicated the issue straight away. The reason you were seeing an exception is that BulletTrainClient is only supposed to be created and initialised once for the application. I have released v2.0.1 which enforces this and it will now throw a NotSupportedException error. I have also added static variable instance
to BulletTrainClient for much greater convenience. After creating a new BulletTrainClient()
during startup of the app you can now use it anywhere by using BulletTrainClient.instance
from flagsmith-dotnet-client.
Hey, that's great news! 🤩 I suggested this might be the problem, but searched in the documentations thoroughly (Nuget.org & BulletTrain front-end code samples & github docs) and when I didn't find anything about it, I just went with it. Do you plan to change the documentations as well? Cheers and thank you!
from flagsmith-dotnet-client.
Hey, yep we've updated the documentation now :). Thanks again
from flagsmith-dotnet-client.
Related Issues (18)
- HttpClient is intended to be instantiated once and re-used throughout the life of an application HOT 1
- When identity is specified a redundant slash character is added in the end HOT 2
- Caching does not implement a max size HOT 3
- API is using deprecated endpoint HOT 1
- Implement SDK-side Caching HOT 7
- Don't log errors using Console.WriteLine HOT 3
- Can't install SDK on new projects HOT 6
- FlagsmithClient's interface was completely changed HOT 2
- using .NET client SDK always return "Value cannot be null. Parameter name: value" error HOT 12
- MV evaluation is not consistent with API in local evaluation mode HOT 1
- Not getting flags after hitting request second time from method GetIdentityFlags HOT 5
- Flagsmith open feature provider HOT 1
- Question: DI registration example HOT 1
- Question: Cancellation token for async methods HOT 2
- Exception: System.ThrowHelper.ThrowInvalidOperationException_ConcurrentOperationsNotSupported HOT 5
- Identity overrides in local evaluation mode
- Fix package validation errors
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flagsmith-dotnet-client.