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: react-native runtime incompatibilities #202

Merged
merged 6 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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() });
nicklasl marked this conversation as resolved.
Show resolved Hide resolved
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
Loading