Skip to content

Commit

Permalink
fix: react-native runtime incompatibilities (#202)
Browse files Browse the repository at this point in the history
* fix: react-native runtime incompatibilities

* fixup! fix: react-native runtime incompatibilities

* fixup! fixup! fix: react-native runtime incompatibilities

* fixup! fixup! fixup! fix: react-native runtime incompatibilities

* fixup! fixup! fixup! fixup! fix: react-native runtime incompatibilities

* fixup! fixup! fixup! fixup! fixup! fix: react-native runtime incompatibilities

---------

Co-authored-by: Nicklas Lundin <[email protected]>
  • Loading branch information
andreas-karlsson and nicklasl authored Oct 3, 2024
1 parent eb79750 commit f594e77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/sdk/src/FlagResolverClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ export function withRequestLogic(fetchImplementation: (request: Request) => Prom
// update send-time before sending
.modifyRequest(async request => {
if (request.method === 'POST') {
const body = JSON.stringify({ ...(await request.json()), sendTime: new Date().toISOString() });
const body = JSON.stringify({ ...(await request.clone().json()), sendTime: new Date().toISOString() });
return new Request(request, { body });
}
return request;
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk/src/fetch-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class FetchBuilder {
let retryCount = 0;

const doRetry = async (e: unknown): Promise<Response> => {
request.signal?.throwIfAborted();
if (request.signal?.aborted ?? false) throw request.signal.reason;
// if there are no more attempts we throw the last error
if (retryCount >= maxRetries) throw e;

Expand Down

0 comments on commit f594e77

Please sign in to comment.