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

Silently ignore duplicate tracing save requests #3767

Merged
merged 18 commits into from
Feb 21, 2019

Conversation

fm3
Copy link
Member

@fm3 fm3 commented Feb 12, 2019

@daniel-wer I wasn’t sure how to test this. You were able to reproduce the error in the first place, could you try if this fixes it? :) Also, my frontend changes might need a cleanup (I just dumped some randomstring generation) Thanks!

URL of deployed dev instance (used for testing):

Steps to test:

  • Open tracing and dev console (chrome)

  • Set network speed to "Slow 3G"

  • Set a node and press "Save"

  • Then quickly check the "Offline" box, so that the request will reach the server, but the response won't reach the frontend ("Slow 3G" is helping with that)

  • Go online again and press "Save"

  • should continue without 409 error

  • normal tracing should be unchanged

  • tracing in multiple tabs should still give conflict errors and force reload

Issues:


@fm3 fm3 added the backend label Feb 12, 2019
@fm3 fm3 self-assigned this Feb 12, 2019
@fm3 fm3 changed the title [WIP] silently ignore duplicate tracing save requests Silently ignore duplicate tracing save requests Feb 13, 2019
@daniel-wer
Copy link
Member

@fm3 Thanks for pushing this, unfortunately this does not fix the issue for me yet, I'm still able to reproduce it.

The way I'm testing it is as follows:

  • Open tracing and dev console (chrome)
  • Set network speed to "Slow 3G"
  • Set a node and press "Save"
  • Then quickly check the "Offline" box, so that the request will reach the server, but the response won't reach the frontend ("Slow 3G" is helping with that)
  • Go online again and press "Save"
  • Now I get the status code 409 response

If you're having trouble reproducing this, we can also have a look at it together on Monday :)

Copy link
Member

@philippotto philippotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 👍 The code looks good. I didn't test it now, since you two both did, right?

// This module should be used to access the Math object, so it can be mocked in the unit tests
// mockRequire("libs/math", myFakeMath);

export default Math;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rename this file to uid_generator.js or something like that and then expose the request id generator, which can be mocked. This would limit the surface area of the mocked code a bit. Now, the mock for the save saga would need to be adapted as soon as we use more Math methods in the save saga (similar to how Math.min had to be re-added to the mock). Also, it suggests to always use this module instead of importing Math directly, but that's not really necessary in most cases.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that's much better, thank you! :)

@fm3 fm3 requested review from youri-k and removed request for jstriebel February 21, 2019 08:41
@fm3
Copy link
Member Author

fm3 commented Feb 21, 2019

@youri-k could you have a look at the backend code? :) We already tested this, but it would be helpful if you could quickly double-check the code anyway. Thanks!

Copy link
Contributor

@youri-k youri-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code LGTM 🙂

@fm3 fm3 merged commit 523d04c into master Feb 21, 2019
@fm3 fm3 deleted the silently-ignore-duplicate-save-requests branch February 21, 2019 11:56
@fm3 fm3 mentioned this pull request Feb 28, 2019
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tracing save: send hash, silently ignore double requests
4 participants