Giter Site home page Giter Site logo

client_common's Issues

Make client-common use MIT

Linked to lenra-io/lenra_cli#94

What should be done

Add GPL license to the project and enhance the current README to match the new Lenra README template. Add more examples and details about how this repository works and what are the specifics of it.

[Task] We need to remove each PR-IS-WIP action call because it's broken

What should be done

We need to remove each PR-IS-WIP action call because it's broken

Technical recommandation

Any technical recommandation or specific warning about this task (if needed)

  • Security issue to be warned of
  • Complexity issue
  • Will it scale ?

Ecological concerns

What can be done to improve the ecological impact of this task ?

  • Can we minimize the data send to the network ?
  • Are data stored ? Can we minimize the amount of stored data ?
  • Is it CPU-intensive ? Can we reduce the CPU charge ?
  • Is it RAM-intensive ? Can we reduce the RAM load ?

Is this task linked with any other ?

Handle navigation properly

Navigation should be handled properly. The navigator defined in this repository should contains all the common routes between backoffice and store such as auth routes.

[Bug]: Unexpected behavior when running same API request multiple times

What happened?

It seems that our current API request system using the models produces an unexpected behavior when running the same API request multiple times (no matter the parameters as long as the Status variable is the same for the requests).

This must be due to the way we handle request statuses. In fact we use a class variable for the Status which means that if two same requests run concurrently it will try to update the same Status variable. The first request to finish will be ok but the second will just not run the request and fetch the result from the first (because the status was updated to done).

A possible solution

Define the Status variables inside of the method that runs the request. This will ensure that two requests cannot edit the same Status at the same time.
This means that we must change where we use the status to observe the state of the request to use the Future's result instead. This should not be a problem.

Before

class Example {
  Status<GetMainEnvResponse> getMainEnvStatus = Status();
  
  Future<GetMainEnvResponse> getMainEnv(int appId) async {
      var res = await getMainEnvStatus.handle(
        () => ApplicationApi.getMainEnv(appId),
        notifyListeners,
      );
      mainEnv = res.mainEnv;
      notifyListeners();
      return res;
    }
}

After

Future<GetMainEnvResponse> getMainEnv(int appId) async {
    Status<GetMainEnvResponse> getMainEnvStatus = Status();
    var res = await getMainEnvStatus.handle(
      () => ApplicationApi.getMainEnv(appId),
      notifyListeners,
    );
    mainEnv = res.mainEnv;
    notifyListeners();
    return res;
  }

Add common views

Common routes between backoffice and store should be added in this repository. ( mainly Auth routes )

Better API Error handling

What should be done

Change the error handling system to match the new specs defined in the following epic: https://github.com/lenra-io/Lenra/issues/53
Now the API returns 4xx/5xx error ranges instead of success true/false and data.
The API returns only one error at a time, not a list of errors.
When 5xx error, no message is returned which means that it should be handle generically on the client.

400 error example :

{
  "error": "This is an error message"
}

Successful data example:

{
  "data": {
    "example": "dataexample"
  }
}

or when receiving a list:

{
  "data": [
    {
      "example": "dataexample"
    },
    {
      "example": "dataexample2"
    }
  ]
}

[Bug]: OauthBaseURL not properly set on disconnect

What happened?

Use the Config.oauthBaseUrl as done in the oauth client class for the disconnect method in the oauthModel.

What browsers are you seeing the problem on?

No response

Version

No response

Relevant log output

No response

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.