Skip to content

Conversation

pivstone
Copy link
Contributor

@pivstone pivstone commented Jun 17, 2025

Description

  • DynamoDB have rate limit, when we hit read cap, AWS SDK Client will throw an exception, but in the implementation it was using callback. So the callback function will never be called.
  • So the value will never return to end of client.
  • An uncaught exception may crash backend application in some cases

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
    • the fix is aiming for node server sdk with dynamodb, should be compatible

Related issues

N/A

Describe the solution you've provided

  • try catch the error and pass undefined to callback function

Describe alternatives you've considered

    1. don't use callback, this is a common and typical issue with mixing callback, promise and async/await
    1. to have a error type for callback. usually callback have two parameters:
callback: (value, error) -> void

Additional note

  • to cover this kind issue, better to have a integration test, we are using Nock to re-produce this issue in our internal, but LD isn't using such a tool, so we didn't at test in PR.

@pivstone pivstone changed the title fix: uncaught dynamodb exception fix: uncaught DynamoDB exception Jun 17, 2025
@pivstone pivstone marked this pull request as ready for review June 17, 2025 09:44
@pivstone pivstone requested a review from a team as a code owner June 17, 2025 09:44
@kinyoklion
Copy link
Member

@pivstone Thank you for the contribution.

@kinyoklion kinyoklion merged commit 91ff683 into launchdarkly:main Jun 17, 2025
26 checks passed
@github-actions github-actions bot mentioned this pull request Jun 17, 2025
kinyoklion pushed a commit that referenced this pull request Jun 17, 2025
🤖 I have created a release *beep* *boop*
---


<details><summary>akamai-edgeworker-sdk-common: 2.0.8</summary>

##
[2.0.8](akamai-edgeworker-sdk-common-v2.0.7...akamai-edgeworker-sdk-common-v2.0.8)
(2025-06-17)


### Dependencies

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

<details><summary>akamai-server-base-sdk: 3.0.8</summary>

##
[3.0.8](akamai-server-base-sdk-v3.0.7...akamai-server-base-sdk-v3.0.8)
(2025-06-17)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.7 to
^2.0.8
    * @launchdarkly/js-server-sdk-common bumped from ^2.15.2 to ^2.16.0
</details>

<details><summary>akamai-server-edgekv-sdk: 1.4.10</summary>

##
[1.4.10](akamai-server-edgekv-sdk-v1.4.9...akamai-server-edgekv-sdk-v1.4.10)
(2025-06-17)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/akamai-edgeworker-sdk-common bumped from ^2.0.7 to
^2.0.8
    * @launchdarkly/js-server-sdk-common bumped from ^2.15.2 to ^2.16.0
</details>

<details><summary>browser-telemetry: 1.0.10</summary>

##
[1.0.10](browser-telemetry-v1.0.9...browser-telemetry-v1.0.10)
(2025-06-17)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-client-sdk bumped from 0.7.1 to 0.8.0
</details>

<details><summary>cloudflare-server-sdk: 2.7.8</summary>

##
[2.7.8](cloudflare-server-sdk-v2.7.7...cloudflare-server-sdk-v2.7.8)
(2025-06-17)


### Dependencies

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

<details><summary>fastly-server-sdk: 0.1.8</summary>

##
[0.1.8](fastly-server-sdk-v0.1.7...fastly-server-sdk-v0.1.8)
(2025-06-17)


### Dependencies

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

<details><summary>jest: 0.1.9</summary>

##
[0.1.9](jest-v0.1.8...jest-v0.1.9)
(2025-06-17)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
* @launchdarkly/react-native-client-sdk bumped from ~10.10.3 to ~10.10.4
</details>

<details><summary>js-client-sdk: 0.8.0</summary>

##
[0.8.0](js-client-sdk-v0.7.1...js-client-sdk-v0.8.0)
(2025-06-17)


### Features

* Add support for an identify queue.
([#842](#842))
([78e9a5e](78e9a5e))


### Dependencies

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

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

##
[1.15.0](js-client-sdk-common-v1.14.1...js-client-sdk-common-v1.15.0)
(2025-06-17)


### Features

* Add support for an identify queue.
([#842](#842))
([78e9a5e](78e9a5e))
</details>

<details><summary>js-server-sdk-common: 2.16.0</summary>

##
[2.16.0](js-server-sdk-common-v2.15.2...js-server-sdk-common-v2.16.0)
(2025-06-17)


### Features

* Add plugin support for node.
([#880](#880))
([6b7bf7e](6b7bf7e))
</details>

<details><summary>js-server-sdk-common-edge: 2.6.7</summary>

##
[2.6.7](js-server-sdk-common-edge-v2.6.6...js-server-sdk-common-edge-v2.6.7)
(2025-06-17)


### Dependencies

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

<details><summary>node-server-sdk: 9.10.0</summary>

##
[9.10.0](node-server-sdk-v9.9.2...node-server-sdk-v9.10.0)
(2025-06-17)


### Features

* Add plugin support for node.
([#880](#880))
([6b7bf7e](6b7bf7e))


### Dependencies

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

<details><summary>node-server-sdk-dynamodb: 6.2.12</summary>

##
[6.2.12](node-server-sdk-dynamodb-v6.2.11...node-server-sdk-dynamodb-v6.2.12)
(2025-06-17)


### Bug Fixes

* uncaught DynamoDB exception
([#888](#888))
([91ff683](91ff683))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.9.2 to 9.10.0
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.10.0
</details>

<details><summary>node-server-sdk-otel: 1.3.0</summary>

##
[1.3.0](node-server-sdk-otel-v1.2.2...node-server-sdk-otel-v1.3.0)
(2025-06-17)


### Features

* Update OTEL tracing hook with latest conventions.
([#887](#887))
([245f1a3](245f1a3))


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.9.2 to 9.10.0
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.10.0
</details>

<details><summary>node-server-sdk-redis: 4.2.12</summary>

##
[4.2.12](node-server-sdk-redis-v4.2.11...node-server-sdk-redis-v4.2.12)
(2025-06-17)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/node-server-sdk bumped from 9.9.2 to 9.10.0
  * peerDependencies
    * @launchdarkly/node-server-sdk bumped from >=9.4.3 to >=9.10.0
</details>

<details><summary>react-native-client-sdk: 10.10.4</summary>

##
[10.10.4](react-native-client-sdk-v10.10.3...react-native-client-sdk-v10.10.4)
(2025-06-17)


### Dependencies

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

<details><summary>server-sdk-ai: 0.9.9</summary>

##
[0.9.9](server-sdk-ai-v0.9.8...server-sdk-ai-v0.9.9)
(2025-06-17)


### Dependencies

* The following workspace dependencies were updated
  * devDependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.15.2 to 2.16.0
  * peerDependencies
    * @launchdarkly/js-server-sdk-common bumped from 2.x to 2.16.0
</details>

<details><summary>vercel-server-sdk: 1.3.31</summary>

##
[1.3.31](vercel-server-sdk-v1.3.30...vercel-server-sdk-v1.3.31)
(2025-06-17)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/js-server-sdk-common-edge bumped from 2.6.6 to 2.6.7
</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.

2 participants