Skip to content

feat: Add Identify hooks to Client SDK#234

Merged
abelonogov-ld merged 25 commits intomainfrom
andrey/client-identify-hook
Mar 13, 2026
Merged

feat: Add Identify hooks to Client SDK#234
abelonogov-ld merged 25 commits intomainfrom
andrey/client-identify-hook

Conversation

@abelonogov-ld
Copy link
Contributor

@abelonogov-ld abelonogov-ld commented Mar 10, 2026

Requirements

Adds BeforeIdentify / AfterIdentify hook stages to the existing hooks infrastructure, mirroring the evaluation series pattern. Hooks execute in forward order for BeforeIdentify and reverse (LIFO) order for AfterIdentify.
Wraps LdClient.IdentifyAsync with the identify hook series so that configured hooks receive callbacks before and after each identify operation, with IdentifySeriesResult.Completed on success and IdentifySeriesResult.Error on failure.
Threads maxWaitTime from Identify / IdentifyAsync into IdentifySeriesContext.Timeout so hooks have visibility into the caller's timeout configuration.

  • 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
image

Note

Medium Risk
Changes LdClient initialization and Identify/IdentifyAsync flow to run new hook callbacks and to always emit an identify series result, which could affect timing/ordering and error propagation around context changes.

Overview
Adds an identify hook series to the SDK hook infrastructure, introducing Hook.BeforeIdentify/Hook.AfterIdentify plus new IdentifySeriesContext (includes timeout) and IdentifySeriesResult (Completed/Error).

Extends the internal hook executor (IHookExecutor, Executor, NoopExecutor) with an async IdentifySeries pipeline that runs hooks in forward order before identify and reverse order after, logging and isolating hook-stage failures while still propagating identify exceptions.

Updates LdClient to route both startup identify event recording and Identify/IdentifyAsync through the new identify series (including threading maxWaitTime into hook context) and adds unit tests covering ordering, data passing, logging on hook errors, result status, and activation during init.

Written by Cursor Bugbot for commit b881e20. This will update automatically on new commits. Configure here.

…dk-identify

* andrey/clientsdk-plugins-and-hooks:
  address feadback
  remove files
  remove identify

# Conflicts:
#	pkgs/sdk/client/src/Hooks/IdentifySeriesResult.cs
* main:
  chore(main): release LaunchDarkly.ServerSdk.Ai 0.9.3 (#233)
  fix: Make defaultValue optional with a disabled default (#232)
  chore(main): release LaunchDarkly.ClientSdk 5.6.0 (#231)
  feat: Add plugin support to Client SDK (#229)

# Conflicts:
#	pkgs/sdk/client/src/Internal/Hooks/Executor/Executor.cs
- Modified the ILdClient and ILdClientExtensions interfaces to add a maxWaitTime parameter to IdentifyAsync.
- Updated related documentation and references across multiple files to reflect the new method signature.
- Enhanced the Identify method implementation to utilize the updated IdentifyAsync method with the maxWaitTime parameter.
- Introduced IdentifySeries method in the hook executor to manage identify operations with hooks, including error handling and execution order.
…ementation

- Updated the IdentifyAsync method to remove the maxWaitTime parameter from the public interface.
- Adjusted related documentation to reflect the new method signature.
- Ensured internal implementation retains the maxWaitTime parameter for flexibility in asynchronous identification operations.
@abelonogov-ld abelonogov-ld requested a review from a team as a code owner March 10, 2026 23:24
- Updated IdentifySeriesContext to accept TimeSpan instead of int for timeout, improving clarity and flexibility.
- Adjusted IdentifySeries method in Executor to align with the new IdentifySeriesContext signature.
- Modified IdentifySeriesTest to utilize TimeSpan.Zero for timeout, ensuring consistency in test cases.
@tanderson-ld tanderson-ld self-requested a review March 11, 2026 14:55
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@tanderson-ld tanderson-ld self-requested a review March 13, 2026 19:55
@abelonogov-ld abelonogov-ld merged commit ddbb81f into main Mar 13, 2026
15 checks passed
@abelonogov-ld abelonogov-ld deleted the andrey/client-identify-hook branch March 13, 2026 20:57
abelonogov-ld pushed a commit that referenced this pull request Mar 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[5.7.0](LaunchDarkly.ClientSdk-v5.6.0...LaunchDarkly.ClientSdk-v5.7.0)
(2026-03-13)


### Features

* Add Identify hooks to Client SDK
([#234](#234))
([ddbb81f](ddbb81f))

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk release-metadata update: only version numbers and changelog
entries are modified, with no runtime code changes in this diff.
> 
> **Overview**
> **Releases `LaunchDarkly.ClientSdk` v5.7.0.**
> 
> Bumps the client SDK version from `5.6.0` to `5.7.0` in
`.release-please-manifest.json` and `LaunchDarkly.ClientSdk.csproj`, and
adds the `5.7.0` changelog entry noting the new *Identify hooks*
feature.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
430f4bc. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
evgenygunko pushed a commit to evgenygunko/CopyWordsDA that referenced this pull request Mar 15, 2026
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [LaunchDarkly.ClientSdk](https://github.com/launchdarkly/dotnet-core) | nuget | minor | `5.6.0` -> `5.7.0` |

---

### Release Notes

<details>
<summary>launchdarkly/dotnet-core (LaunchDarkly.ClientSdk)</summary>

### [`v5.7.0`](https://github.com/launchdarkly/dotnet-core/releases/tag/LaunchDarkly.ClientSdk-v5.7.0): LaunchDarkly.ClientSdk: v5.7.0

[Compare Source](launchdarkly/dotnet-core@LaunchDarkly.ClientSdk-v5.6.0...LaunchDarkly.ClientSdk-v5.7.0)

##### Features

-   Add Identify hooks to Client SDK ([#&#8203;234](launchdarkly/dotnet-core#234)) ([ddbb81f](launchdarkly/dotnet-core@ddbb81f))

***

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

<!-- CURSOR_SUMMARY -->

</details>

---

### Configuration

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

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or PR is renamed to start with "rebase!".

👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired.

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
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