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

RASA-X API - PUT stories does add instead of replace #4168

Closed
rgstephens opened this issue Aug 4, 2019 · 5 comments

Comments

@rgstephens
Copy link
Contributor

commented Aug 4, 2019

Rasa version: 1.1.4

Rasa X version: 0.20.0

Issue:

With the stories.md file below, and with no stories loaded in my Rasa X instances I do the following:

  1. call PUT and the stories are added. Since the stories don't exist, shouldn't this report an eror and do nothing instead of adding the stories?
  2. I then call PUT again with the same stories and I end up with two copies of each story for a total of four stories. This should replace the existing stories.

PUT appears to be identical to POST for stories.

Content of stories file (if relevant):

# new story 1, stories1.md
* hello
  - utter_hi_there

# new story 2, stories1.md
* hello
  - utter_hi_there

@rgstephens rgstephens added the bug label Aug 4, 2019

@RasaHQ RasaHQ deleted a comment from sara-tagger Aug 5, 2019

@MetcalfeTom

This comment has been minimized.

Copy link
Contributor

commented Aug 5, 2019

Hi @rgstephens,

Thanks for letting us know about this bug, I tested it on my end with the same result so I'll add it to the backlog.
Checking through the source code, seems like the stories aren't deleted with the query we execute upon receiving the PUT request.

@MetcalfeTom MetcalfeTom added the Rasa X label Aug 5, 2019

@erohmensing erohmensing self-assigned this Aug 12, 2019

@wochinge

This comment has been minimized.

Copy link
Contributor

commented Aug 12, 2019

@erohmensing I overlooked that you already assigned yourself. Did you already fix it? Otherwise I found the error 🙈 The username doesn't get passed as username to replace_stories, but as filename

@erohmensing

This comment has been minimized.

Copy link
Member

commented Aug 13, 2019

Hahaha i just picked it as my maintenance task for the week but if you already have the solution, go for it 😋 i haven't looked at it yet. just let me know and i'll switch the assignment

@wochinge

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2019

i haven't looked at it yet
phew 👍

Ok, will ask for your review then :-)

@wochinge wochinge assigned wochinge and unassigned erohmensing Aug 13, 2019

@wochinge wochinge closed this Aug 13, 2019

@wochinge

This comment has been minimized.

Copy link
Contributor

commented Aug 13, 2019

@rgstephens I fixed the problem that stories are added when they should be updated.

The endpoint deletes all the old stories and adds the new ones (means it there stories are replaced). How could we make this behaviour more obvious? The API spec describes the endpoint by saying it Replace stories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.