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: [AUTH-2047] disable fetch cache for all requests #271

Merged
merged 2 commits into from
Oct 18, 2023
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
1 change: 1 addition & 0 deletions dist/shared/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/shared/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export async function request<T>(
response = await fetch(url.toString(), {
method: requestConfig.method,
body: body,
cache: "no-store",
...fetchConfig,
});
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "stytch",
"version": "9.0.4",
"version": "9.0.5",
Copy link
Contributor

Choose a reason for hiding this comment

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

Just reasoning through: I agree this is a PATCH bump since it fixes errant behavior and fixes a bug for people using Stytch in conjunction with a common framework. I was wondering at first if this should be a MINOR bump, but PATCH seems appropriate.

"description": "A wrapper for the Stytch API",
"types": "./types/lib/index.d.ts",
"main": "./dist/index.js",
Expand Down
4 changes: 4 additions & 0 deletions test/shared/shared.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ describe("request", () => {

expect(fetchMock).toHaveBeenCalledWith("http://localhost:8000/hello", {
method: "GET",
cache: "no-store",
...MOCK_FETCH_CONFIG,
});
});
Expand All @@ -37,6 +38,7 @@ describe("request", () => {
await request(MOCK_FETCH_CONFIG, {
url: "http://localhost:8000/hello",
method: "GET",
cache: "no-store",
params: {
string: "here",
number: 1234,
Expand All @@ -47,6 +49,7 @@ describe("request", () => {

expect(fetchMock).toHaveBeenCalledWith(expectedURL, {
method: "GET",
cache: "no-store",
...MOCK_FETCH_CONFIG,
});
});
Expand All @@ -67,6 +70,7 @@ describe("request", () => {

expect(fetchMock).toHaveBeenCalledWith("http://localhost:8000/hello", {
method: "GET",
cache: "no-store",
body: `{"string":"here","number":1234,"deep":{"array":[123]}}`,
...MOCK_FETCH_CONFIG,
});
Expand Down