Skip to content

FFM-11788 Add maxStreamRetries config option #126

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

Merged
merged 12 commits into from
Jul 31, 2024
Merged

FFM-11788 Add maxStreamRetries config option #126

merged 12 commits into from
Jul 31, 2024

Conversation

erdirowlands
Copy link
Contributor

What

Adds a config option called maxStreamRetries to limit the retries that occur if the stream disconnects. By default, the retries remain at Infinite which is the existing behaviour. If retries are exhausted, one of two states can occur

  1. If Polling is enabled, the SDK will remain in polling mode and no further streaming reconnection attempts will be made. The default polling option, if not supplied, is whatever the streamingEnabled value is.
    or
  2. If polling is disabled, the SDK will not get any further evaluation updates for the remainder of the SDK client instance's life. The SDK will need re-initialised, e.g the app being restarted, to get new evaluations in this state.

Why

A customer has asked for a way to limit stream retries

Testing

New unit tests for the Streamer class.

Manual using local proxy tool to simulate disconnections.

src/stream.ts Outdated
if (this.configurations.pollingEnabled) {
this.logErrorMessage('Max streaming retries reached. Staying in polling mode.')
} else {
this.logErrorMessage('Max streaming retries reached.')
Copy link

Choose a reason for hiding this comment

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

Wondering would it be a good idea to indicate that polling will also be stopped in this else statement log so that users would know they're gonna stop receiving updates?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks - good catch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@erdirowlands erdirowlands merged commit 1e4218b into main Jul 31, 2024
1 check passed
@erdirowlands erdirowlands deleted the FFM-11788 branch July 31, 2024 15:29
github-merge-queue bot referenced this pull request in open-feature/playground Sep 12, 2024
…1.28.0 (#372)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[@harnessio/ff-javascript-client-sdk](https://redirect.github.com/harness/ff-javascript-client-sdk)
| [`1.26.2` ->
`1.28.0`](https://renovatebot.com/diffs/npm/@harnessio%2fff-javascript-client-sdk/1.26.2/1.28.0)
|
[![age](https://developer.mend.io/api/mc/badges/age/npm/@harnessio%2fff-javascript-client-sdk/1.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@harnessio%2fff-javascript-client-sdk/1.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@harnessio%2fff-javascript-client-sdk/1.26.2/1.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@harnessio%2fff-javascript-client-sdk/1.26.2/1.28.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>harness/ff-javascript-client-sdk
(@&#8203;harnessio/ff-javascript-client-sdk)</summary>

###
[`v1.28.0`](https://redirect.github.com/harness/ff-javascript-client-sdk/releases/tag/1.28.0)

[Compare
Source](https://redirect.github.com/harness/ff-javascript-client-sdk/compare/1.27.0...1.28.0)

#### What's Changed

Enhancements:
FFM-11972 Add`authRequestReadTimeout` config option - see
[readme](https://redirect.github.com/harness/ff-javascript-client-sdk/blob/main/README.md#authentication-request-timeout)
for further information and how to enable
[@&#8203;erdirowlands](https://redirect.github.com/erdirowlands) in
[https://github.com/harness/ff-javascript-client-sdk/pull/135](https://redirect.github.com/harness/ff-javascript-client-sdk/pull/135)

Bug fixes
FFM-11972 If authentication fails the the correct error will be logged
instead of `Invalid Token` by
[@&#8203;erdirowlands](https://redirect.github.com/erdirowlands) in
[https://github.com/harness/ff-javascript-client-sdk/pull/135](https://redirect.github.com/harness/ff-javascript-client-sdk/pull/135)

**Full Changelog**:
harness/ff-javascript-client-sdk@1.27.0...1.28.0

###
[`v1.27.0`](https://redirect.github.com/harness/ff-javascript-client-sdk/releases/tag/1.27.0)

[Compare
Source](https://redirect.github.com/harness/ff-javascript-client-sdk/compare/1.26.3...1.27.0)

#### What's Changed

##### Enhancements:

- FFM-11788 Add `maxStreamRetries` config option by
[@&#8203;erdirowlands](https://redirect.github.com/erdirowlands) in
[https://github.com/harness/ff-javascript-client-sdk/pull/126](https://redirect.github.com/harness/ff-javascript-client-sdk/pull/126)

If retries are exhausted, one of two states can occur:

1. If Polling is enabled, the SDK will remain in polling mode and no
further streaming reconnection attempts will be made. The default
polling option, if not supplied, is whatever the streamingEnabled value
is.
    or
2. If polling is disabled, the SDK will not get any further evaluation
updates for the remainder of the SDK client instance's life. The SDK
will need re-initialised, e.g the app being restarted, to get new
evaluations in this state.

##### Bug fixes

FFM-11852 Fixes an edge case where if the stream disconnects and resumes
during a request made by the fallback poller (60 seconds later), the
fallback poller will not be disabled and will continue polling for the
lifetime of the SDK instance by
[@&#8203;erdirowlands](https://redirect.github.com/erdirowlands) in
[https://github.com/harness/ff-javascript-client-sdk/pull/131](https://redirect.github.com/harness/ff-javascript-client-sdk/pull/131)

**Full Changelog**:
harness/ff-javascript-client-sdk@1.26.3...1.27.0

###
[`v1.26.3`](https://redirect.github.com/harness/ff-javascript-client-sdk/releases/tag/1.26.3)

[Compare
Source](https://redirect.github.com/harness/ff-javascript-client-sdk/compare/1.26.2...1.26.3)

#### What's Changed

-   Maintenance: Patches the following CVEs
    -   GHSA-3h5v-q93c-6h6q
    -   GHSA-grv7-fg5c-xmjg

[https://github.com/harness/ff-javascript-client-sdk/pull/127](https://redirect.github.com/harness/ff-javascript-client-sdk/pull/127)pull/127
by [@&#8203;erdirowlands](https://redirect.github.com/erdirowlands)

**Full Changelog**:
harness/ff-javascript-client-sdk@1.26.2...1.26.3

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/open-feature/playground).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC43NC4xIiwidXBkYXRlZEluVmVyIjoiMzguNzQuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsicmVub3ZhdGUiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

2 participants