Skip to content

Conversation

@yusinto
Copy link
Contributor

@yusinto yusinto commented Mar 25, 2024

No description provided.

@shortcut-integration
Copy link

Comment on lines -171 to -184
const changedKeys = calculateFlagChanges(this.flags, dataJson);
this.context = context;
this.flags = dataJson;
this.onIdentifyResolve(identifyResolve, dataJson, context, 'streamer PUT');
await this.platform.storage?.set(canonicalKey, JSON.stringify(this.flags));

if (changedKeys.length > 0) {
this.logger.debug(`Emitting changes from PUT: ${changedKeys}`);
// emitting change resolves identify
this.emitter.emit('change', context, changedKeys);
} else {
// manually resolve identify
this.logger.debug('Not emitting changes from PUT');
identifyResolve();
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Dry'd this to onIdentifyResolve.

}

const { identifyPromise, identifyResolve } = this.createPromiseWithListeners();
this.eventProcessor?.sendEvent(this.eventFactoryDefault.identifyEvent(checkedContext));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was the missing piece to send identify event.

@@ -1,5 +1,4 @@
import { ClientContext, internal, Platform } from '@launchdarkly/js-sdk-common';
import { EventProcessor } from '@launchdarkly/js-sdk-common/dist/internal';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is an unrelated bug. I'm not sure why this wasn't caught by the linter.


this.identifyChangeListener = (c: LDContext, changedKeys: string[]) => {
this.logger.debug(`change: context: ${JSON.stringify(c)}, flags: ${changedKeys}`);
resolve();
Copy link
Contributor Author

@yusinto yusinto Mar 25, 2024

Choose a reason for hiding this comment

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

Resolve is now explicitly called when appropriate, rather than here. This is more sensible because not all 'change' events need to resolve the identify promise.

@yusinto yusinto enabled auto-merge (squash) March 25, 2024 22:21
@yusinto yusinto merged commit 1d73462 into main Mar 25, 2024
@yusinto yusinto deleted the yus/sc-237713/escalation-multi-contexts-aren-t-appearing branch March 25, 2024 22:43
@github-actions github-actions bot mentioned this pull request Mar 25, 2024
yusinto pushed a commit that referenced this pull request Mar 25, 2024
🤖 I have created a release *beep* *boop*
---


<details><summary>@launchdarkly/akamai-edgeworker-sdk-common:
1.1.2</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from ^2.2.1 to ^2.2.2
</details>

<details><summary>@launchdarkly/akamai-server-base-sdk: 2.1.2</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^1.1.1 to
^1.1.2
    * @launchdarkly/js-server-sdk-common bumped from ^2.2.1 to ^2.2.2
</details>

<details><summary>@launchdarkly/akamai-server-edgekv-sdk:
1.1.2</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^1.1.1 to
^1.1.2
    * @launchdarkly/js-server-sdk-common bumped from ^2.2.1 to ^2.2.2
</details>

<details><summary>@launchdarkly/cloudflare-server-sdk: 2.4.2</summary>

### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-server-sdk-common-edge bumped from 2.2.1 to 2.2.2
</details>

<details><summary>js-client-sdk-common: 1.0.3</summary>

##
[1.0.3](js-client-sdk-common-v1.0.2...js-client-sdk-common-v1.0.3)
(2024-03-25)


### Bug Fixes

* Send identify event.
([#407](#407))
([1d73462](1d73462))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-sdk-common bumped from 2.3.0 to 2.3.1
</details>

<details><summary>js-sdk-common: 2.3.1</summary>

##
[2.3.1](js-sdk-common-v2.3.0...js-sdk-common-v2.3.1)
(2024-03-25)


### Bug Fixes

* Send identify event.
([#407](#407))
([1d73462](1d73462))
</details>

<details><summary>@launchdarkly/js-server-sdk-common: 2.2.2</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-sdk-common bumped from 2.3.0 to 2.3.1
</details>

<details><summary>@launchdarkly/js-server-sdk-common-edge:
2.2.2</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.2.1 to 2.2.2
</details>

<details><summary>@launchdarkly/node-server-sdk: 9.2.2</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.2.1 to 2.2.2
</details>

<details><summary>@launchdarkly/node-server-sdk-dynamodb:
6.1.4</summary>

### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.2.1 to 9.2.2
</details>

<details><summary>@launchdarkly/node-server-sdk-redis: 4.1.4</summary>

### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.2.1 to 9.2.2
</details>

<details><summary>@launchdarkly/react-native-client-sdk:
10.0.4</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-client-sdk-common bumped from 1.0.2 to 1.0.3
</details>

<details><summary>@launchdarkly/vercel-server-sdk: 1.3.3</summary>

### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common-edge bumped from 2.2.1 to 2.2.2
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[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.

3 participants