Giter Club home page Giter Club logo

Comments (8)

dabeeeenster avatar dabeeeenster commented on August 20, 2024

Hi @sevikarakose - we'll take a look at this.

from flagsmith-dotnet-client.

lukefanning avatar lukefanning commented on August 20, 2024

@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.

sevikarakose avatar sevikarakose commented on August 20, 2024

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.

lukefanning avatar lukefanning commented on August 20, 2024

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.

sevikarakose avatar sevikarakose commented on August 20, 2024

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.

lukefanning avatar lukefanning commented on August 20, 2024

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.

sevikarakose avatar sevikarakose commented on August 20, 2024

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.

lukefanning avatar lukefanning commented on August 20, 2024

Hey, yep we've updated the documentation now :). Thanks again

from flagsmith-dotnet-client.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.