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

chore: adds CompositeDataSource for FDv2 support #787

Open
wants to merge 8 commits into
base: ta/fdv2-temporary-holding
Choose a base branch
from

Conversation

tanderson-ld
Copy link
Contributor

@tanderson-ld tanderson-ld commented Feb 21, 2025

Requirements

  • I have added test coverage for new or changed functionality

  • I have followed the repository's pull request submission guidelines

  • I have validated my changes against all supported platform versions
    Will be done on target temp branch eventually.

Related issues

SDK-857

@tanderson-ld tanderson-ld requested a review from a team as a code owner February 21, 2025 18:56
@tanderson-ld tanderson-ld changed the title Ta/sdk 857/composite datasource chore: adds CompositeDataSource for FDv2 support Feb 21, 2025
@tanderson-ld tanderson-ld requested a review from kinyoklion March 4, 2025 21:19
@tanderson-ld tanderson-ld requested a review from kinyoklion March 14, 2025 22:34
@tanderson-ld tanderson-ld requested review from a team and abarker-launchdarkly March 24, 2025 16:14
@@ -43,7 +43,7 @@
"test": "echo Please run tests for individual packages.",
"coverage": "npm run test -- --coverage",
"contract-test-service": "npm --prefix contract-tests install && npm --prefix contract-tests start",
"contract-test-harness": "curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/master/downloader/run.sh \\ | VERSION=v2 PARAMS=\"-url http://localhost:8000 -debug -stop-service-at-end $TEST_HARNESS_PARAMS\" sh",
"contract-test-harness": "curl -s https://raw.githubusercontent.com/launchdarkly/sdk-test-harness/master/downloader/run.sh \\ | VERSION=v2 PARAMS=\"-url http://localhost:8000 -debug --skip-from=./contract-tests/testharness-suppressions.txt -stop-service-at-end $TEST_HARNESS_PARAMS\" sh",
Copy link
Contributor

Choose a reason for hiding this comment

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

NON-BLOCKING: Did you intend to commit this or was it just left over from debugging?

// these local variables are used for handling automatic transition related to data source status (ex: recovering to primary after
// secondary has been valid for N many seconds)
let lastState: DataSourceState | undefined;
let cancelScheduledTransition: () => void = () => {};
Copy link
Contributor

Choose a reason for hiding this comment

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

It's difficult to tell but this might be problematic. Consider the case where this is pushed to _cancelTokens more than once. Since _consumeCancelToken() removes the token using indexOf which finds the element by strict equality, it would only find and remove the first instance.

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.

3 participants