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

fix: update requestId for Idempotency when resending #63

Merged
merged 2 commits into from
Mar 2, 2023
Merged

Conversation

cbaker6
Copy link
Member

@cbaker6 cbaker6 commented Mar 2, 2023

New Pull Request Checklist

Issue Description

When resending requests after an error is thrown from the server, the same requestId is currently used. This can result in the parse-server throwing Duplicate Request when Idempotency is enabled on the server-side.

Approach

When resending a request, update the requestId if a request currently contains a requestId since the original request was already handled by the server.

TODOs before merging

  • Add tests
  • Add entry to changelog
  • Add changes to documentation (guides, repository pages, in-code descriptions)

@codecov
Copy link

codecov bot commented Mar 2, 2023

Codecov Report

Merging #63 (0988b83) into main (9c8f139) will increase coverage by 0.02%.
The diff coverage is 88.88%.

❗ Current head 0988b83 differs from pull request most recent head 04ab720. Consider uploading reports for the commit 04ab720 to get more accurate results

@@            Coverage Diff             @@
##             main      #63      +/-   ##
==========================================
+ Coverage   90.41%   90.44%   +0.02%     
==========================================
  Files         164      164              
  Lines       16513    16521       +8     
==========================================
+ Hits        14931    14942      +11     
+ Misses       1582     1579       -3     
Impacted Files Coverage Δ
Sources/ParseSwift/Extensions/URLSession.swift 86.26% <80.00%> (-0.12%) ⬇️
Sources/ParseSwift/API/API.swift 99.40% <100.00%> (+0.01%) ⬆️
Sources/ParseSwift/LiveQuery/ParseLiveQuery.swift 75.11% <0.00%> (+0.58%) ⬆️

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

@cbaker6 cbaker6 merged commit fd28500 into main Mar 2, 2023
@cbaker6 cbaker6 deleted the fixIdempotency branch March 2, 2023 17:43
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.

1 participant