refactor: update identify method to optionally return results #1049
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requirements
Related issues
sdk-1657
Describe the solution you've provided
identifymethod inLDClientImplto return a promise with the results of the identification operation whenreturnResultsis set to true inidentifyOptions.BrowserClientImplto align with the newidentifymethod signature, ensuring it now calls the updated method and handles results appropriately.returnResultsoption inLDIdentifyOptionsto clarify its usage and behavior.Additional context
I made this change to make it easier for us to transition the identify method signiture for RN. In the browser 4.x SDK we are hardcoding the identify method to the new implementation. The idea here is to allow developers to easily revert to previous behavior if necessary.
Note
Introduces optional result-returning behavior for
identifyand aligns the browser client with it.LDClient.identifyto returnPromise<void | LDIdentifyResult>;LDClientImpl.identifyreturnsidentifyResultwhenidentifyOptions.returnResultsis true, otherwise preserves existing throw-on-error behaviorreturnResultstoLDIdentifyOptionswith documentationidentifyto requirestart()first, defaultsheddable=true, forcesreturnResults=true, starts goal tracking;start()now callsidentifyinstead ofidentifyResult; PIMPL mapping updated toidentifyWritten by Cursor Bugbot for commit 7fcd513. This will update automatically on new commits. Configure here.