Navigation Menu

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

proposal for repeated identical requests #27

Open
Tracked by #201
derhuerst opened this issue Oct 20, 2021 · 2 comments
Open
Tracked by #201

proposal for repeated identical requests #27

derhuerst opened this issue Oct 20, 2021 · 2 comments

Comments

@derhuerst
Copy link

If the same request returns different data during different invocations, replayer has no way of differentiating between the two invocations. This can happen when, for example, a resources is fetched using a GET request, it is modified using a PUT request, and it is fetched once more using a GET request to verify that it was updated successfully.

One could add an option to replayer that enumerates the identical requests: It would count how often each request hash has occurred and store fixtures including their number.

As an example, let's assume that GET /foo's hash is abc123 and PATCH /foo … is def456`, and we do three requests:

  1. GET /foo
  2. PATCH /foo …
  3. GET /foo

There would now be three fixtures:

  • abc123-1
  • def456-1
  • abc123-2

Of course, this wouldn't work in every use case, but AFAICT it solves all basic "read, modify, read again" use cases.

@derhuerst
Copy link
Author

@aneilbaboo sorry for bothering you! do you have an opinion on this? would you accept a PR for this?

@derhuerst
Copy link
Author

any news on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant