diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ae48f1a..19c2487 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.4.8" + ".": "1.4.9" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b47d4b..4535e9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 1.4.9 (2026-02-20) + +Full Changelog: [v1.4.8...v1.4.9](https://github.com/OneBusAway/go-sdk/compare/v1.4.8...v1.4.9) + +### Bug Fixes + +* allow canceling a request while it is waiting to retry ([a90dd4e](https://github.com/OneBusAway/go-sdk/commit/a90dd4e9deb309c8193c802bae576a418e567347)) + + +### Chores + +* update mock server docs ([bf2cab0](https://github.com/OneBusAway/go-sdk/commit/bf2cab013c1eb2f67c753b3c5c535fec081c4af7)) + ## 1.4.8 (2026-01-17) Full Changelog: [v1.4.7...v1.4.8](https://github.com/OneBusAway/go-sdk/compare/v1.4.7...v1.4.8) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2e71161..f4adc46 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,8 +49,7 @@ $ go mod edit -replace github.com/OneBusAway/go-sdk=/path/to/go-sdk Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests. ```sh -# you will need npm installed -$ npx prism mock path/to/your/openapi.yml +$ ./scripts/mock ``` ```sh diff --git a/README.md b/README.md index 484c7b5..827eee0 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Or to pin the version: ```sh -go get -u 'github.com/OneBusAway/go-sdk@v1.4.8' +go get -u 'github.com/OneBusAway/go-sdk@v1.4.9' ``` diff --git a/internal/requestconfig/requestconfig.go b/internal/requestconfig/requestconfig.go index d1d4e2d..5684595 100644 --- a/internal/requestconfig/requestconfig.go +++ b/internal/requestconfig/requestconfig.go @@ -470,7 +470,11 @@ func (cfg *RequestConfig) Execute() (err error) { res.Body.Close() } - time.Sleep(retryDelay(res, retryCount)) + select { + case <-ctx.Done(): + return ctx.Err() + case <-time.After(retryDelay(res, retryCount)): + } } // Save *http.Response if it is requested to, even if there was an error making the request. This is diff --git a/internal/testutil/testutil.go b/internal/testutil/testutil.go index 826d266..31103e9 100644 --- a/internal/testutil/testutil.go +++ b/internal/testutil/testutil.go @@ -16,10 +16,10 @@ func CheckTestServer(t *testing.T, url string) bool { t.Fatalf("strconv.ParseBool(os.LookupEnv(%s)) failed: %s", SKIP_MOCK_TESTS, err) } if skip { - t.Skip("The test will not run without a mock Prism server running against your OpenAPI spec") + t.Skip("The test will not run without a mock server running against your OpenAPI spec") return false } - t.Errorf("The test will not run without a mock Prism server running against your OpenAPI spec. You can set the environment variable %s to true to skip running any tests that require the mock server", SKIP_MOCK_TESTS) + t.Errorf("The test will not run without a mock server running against your OpenAPI spec. You can set the environment variable %s to true to skip running any tests that require the mock server", SKIP_MOCK_TESTS) return false } } diff --git a/internal/version.go b/internal/version.go index 3f40a4f..c4d2cdd 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "1.4.8" // x-release-please-version +const PackageVersion = "1.4.9" // x-release-please-version