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

Implement proper async call of sagas #51

Closed
malave opened this issue Jan 2, 2018 · 3 comments
Closed

Implement proper async call of sagas #51

malave opened this issue Jan 2, 2018 · 3 comments

Comments

@malave
Copy link
Contributor

malave commented Jan 2, 2018

Right now where are mostly calling an action, wait for the response and then either update the UI or redirect.

There are a few cases where another saga must be call and I had to perform some work arounds but there are some cases where this just created am unexpected behavior.

According to the redux page we could use redux-thunk or other libraries.

Redux Sagas is supposed to be able to handle this but so far I haven't been successful doing this.

The purpose of this issue is to investigate how to perform this with sagas or other libraries. Also part of the implementation should stop the rest of the actions after an error.

Here are the scenarios that I found so far:

  • Delete Domain, Intent and Entity: This required that we re populate the lists after deleting. (working work around in place but is not ideal code)
  • Agent delete: reload list of available agents, redirect current agent, redirect to / (currently the redirect doesn't work and sometime the agent list doesn't populate)
  • Create Domain, Intent, Entity: Redirect to list (not implemented)
@wrathagom
Copy link
Contributor

@malave when I select a domain in the intent list page the list doesn't always load is that related?

Also the client error console fills up with

Unhandled Promise Rejection: Invariant Violation: parentComponent must be a valid React Component

every time I navigate to a list page. Is that related?

@wrathagom
Copy link
Contributor

I created #59 just in case

malave added a commit that referenced this issue Jan 15, 2018
- When the API creates an agent the id is a number instead of a string like everywhere else, this is fixed

Reference: #48, #51
@malave
Copy link
Contributor Author

malave commented Jan 16, 2018

Errors reported by @dcalvom:

  • When you create an agent the redirect is to http://localhost:3500/wizard/entity-intent instead of http://localhost:3500/wizard/domain
  • The combo of domains in the intent list page was loaded, but was once you pick any domain the intents list isn't loaded. If you click again in the intents - link in the menu the domain list goes empty
  • AgentName is not being filled in the webhook request
  • The list of domains wasn't loaded, if you click on the domains link in the menu twice, the list is loaded.
  • Agent entities wasn't loaded, if you click twice in the entities link in the menu, the list is loaded.
  • The intent post doesn't have the intent name inlcuded. In the past once the intent was created the reference to the id was pssed
  • Delete agent doesn't works
  • Delete domain, intent and entity doesn't works (I don't know if this is already implemented)

malave added a commit that referenced this issue Jan 16, 2018
- Changed Dockerfiles to be more efficient by properly caching `node_modules` when necessary

References: #51
malave added a commit that referenced this issue Jan 16, 2018
… correctly and causing an error if another element in the same position was deleted

References: #51
malave added a commit that referenced this issue Jan 17, 2018
- [x] When you create an agent the redirect is to http://localhost:3500/wizard/entity-intent instead of http://localhost:3500/wizard/domain
- [x] The combo of domains in the intent list page was loaded, but was once you pick any domain the intents list isn't loaded. If you click again in the `intents` - link in the menu the domain list goes empty
- [x] AgentName is not being filled in the webhook request
- [x] The intent post doesn't have the intent name inlcuded. In the past once the intent was created the reference to the id was pssed
- [x] Delete agent doesn't works
- [x] Delete domain, intent and entity doesn't works (I don't know if this is already implemented)

Reference #51
malave added a commit that referenced this issue Jan 17, 2018
… correctly and causing an error if another element in the same position was deleted

- Added changes suggested by @dcalvom
- Changed Dockerfiles to be more efficient by properly caching `node_modules` when necessary
- Fixed configuration that made docker fail to build
- Correctly called generator function in sagas to be async
- When the API creates an agent the id is a number instead of a string like everywhere else, this is fixed
- Fixed error in converse where it didn't call the API correctly
- Correctly handle of rejected promises in sagas after doing the refactoring
- Refactored all sagas to use the swagger middleware
- Modified sagas to use `API_URL` environment variable
- Added `dotenv-webpack` plug in to load env variables from `.env` file if available
- Modified compose file to pass API url variable to container
Errors reported by @dcalvom:
- [x] When you create an agent the redirect is to http://localhost:3500/wizard/entity-intent instead of http://localhost:3500/wizard/domain
- [x] The combo of domains in the intent list page was loaded, but was once you pick any domain the intents list isn't loaded. If you click again in the `intents` - link in the menu the domain list goes empty
- [x] AgentName is not being filled in the webhook request
- [x] The intent post doesn't have the intent name inlcuded. In the past once the intent was created the reference to the id was pssed
- [x] Delete agent doesn't works
- [x] Delete domain, intent and entity doesn't works (I don't know if this is already implemented)
Reference: #48, #51
@malave malave closed this as completed Jan 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants