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

block cancellations: after validation, check if request is latest #214

Merged
merged 1 commit into from
Oct 24, 2022

Conversation

metachris
Copy link
Collaborator

📝 Summary

An earlier request could override a newer request if the validation was slow.

This PR adds a receivedAt check, to check after validation whether the request is still the latest.


✅ I have run these commands

  • make lint
  • make test-race
  • go mod tidy
  • I have seen and agree to CONTRIBUTING.md

@codecov-commenter
Copy link

codecov-commenter commented Oct 22, 2022

Codecov Report

Merging #214 (85d663d) into main (285eff3) will decrease coverage by 0.00%.
The diff coverage is 25.00%.

@@            Coverage Diff             @@
##             main     #214      +/-   ##
==========================================
- Coverage   23.94%   23.93%   -0.01%     
==========================================
  Files          19       19              
  Lines        2339     2365      +26     
==========================================
+ Hits          560      566       +6     
- Misses       1701     1719      +18     
- Partials       78       80       +2     
Flag Coverage Δ
unittests 23.93% <25.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
datastore/datastore.go 33.33% <ø> (+0.83%) ⬆️
services/api/service.go 17.13% <8.33%> (-0.17%) ⬇️
datastore/redis.go 52.28% <35.00%> (-1.78%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@metachris metachris merged commit b982282 into main Oct 24, 2022
@metachris metachris deleted the cancel-race branch October 24, 2022 09:52
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

Successfully merging this pull request may close these issues.

3 participants