Skip to content

feat: Make Status ToString() methods format consistent #247

Merged
jsonbailey merged 2 commits intolaunchdarkly:mainfrom
HarleyRossetto:add-labels-to-ToString
Apr 16, 2026
Merged

feat: Make Status ToString() methods format consistent #247
jsonbailey merged 2 commits intolaunchdarkly:mainfrom
HarleyRossetto:add-labels-to-ToString

Conversation

@HarleyRossetto
Copy link
Copy Markdown
Contributor

@HarleyRossetto HarleyRossetto commented Apr 10, 2026

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

Related issues

Provide links to any issues in this repository or elsewhere relating to this pull request.

N/A

Describe the solution you've provided

The different Status structs that expose internal state of the client have different formatted when string-ified. If the state is logged or otherwise serialised as a string it is not possible to determine what the values mean without understanding the underlying types. This change aligns 3 status ToString() methods to follow a consistent format, including labelling for the different fields exposed.


The BigSegmentStoreStatus struct returns data in the format (Available={0},Stale{1)} injecting the fields in allowing the type to be easily string-ified.

DataSourceStatus and DataStoreStatus only output a string of the internal fields without labels, making decoding the results difficult without understanding the details of these types.

e.g.
DataStoreStatus(True,False)
DataSourceStatus(Initializing,4/10/2026 10:42:08 PM,)
or
DataSourceStatus(Initializing,4/10/2026 10:42:08 PM,UNKNOWN(Connection refused (localhost:5279))@4/10/2026 10:42:18 PM) when errors are present.

DataSourceStatus is reasonably understandable as is, however DataStoreStatus is not.

This change adds in the labelling of fields so they can be clearly understood when using the default ToString() implementation.

BigSegmentStoreStatus has also been updated to include its type name like the other two status providers. Now all follow the pattern set by the other two providers: Type(Field=Value,Field2=Value...).

(Available=False,Stale=False)
to
BigSegmentStatus(Available=False,Stale=False)

Also include minor changes to ErrorInfo's ToString() method to utilise character append overloads for single characters rather than string variation as it is a cheaper call.

Describe alternatives you've considered

I considered applying this logic to ErrorInfo's ToString(), however the output of that is fairly clear and can be understood without additional labels.

Additional context

Test coverage was ignored as no existing tests exist for these methods, and they are not utilised by the SDK itself.


Note

Low Risk
Only affects ToString() output (logging/diagnostics), with minimal behavioral risk beyond potentially breaking code/tests that assert exact string formats.

Overview
Makes the string representations of status structs consistent and self-describing by updating ToString() in BigSegmentStoreStatus, DataSourceStatus, and DataStoreStatus to include the type name and Field=Value labels.

Also makes a small micro-optimization in DataSourceStatus.ErrorInfo.ToString() by using StringBuilder.Append(char) for single-character separators.

Reviewed by Cursor Bugbot for commit a1df382. Bugbot is set up for automated code reviews on this repo. Configure here.

@HarleyRossetto HarleyRossetto requested a review from a team as a code owner April 10, 2026 13:58
Copy link
Copy Markdown

@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

Reviewed by Cursor Bugbot for commit ad283f7. Configure here.

Comment thread pkgs/sdk/server/src/Interfaces/DataSourceStatus.cs Outdated
@HarleyRossetto HarleyRossetto changed the title Make Status ToString() methods format consistent fix: make Status ToString() methods format consistent Apr 10, 2026
…gSegmentStoreStatus ToString()

The BigSegmentStoreStatus struct returns data in the format
(Available={0},Stale{1)} injecting the fields in allowing the type to be
easily stringified.

DataSourceStatus and DataStoreStatus only output a string of the
internal fields without labels, making decoding the results difficult
without understanding the datils of these types.

This change adds in the labeling of fields so they can be clearly
understood when using the default ToString() implementation.

BigSegmentStoreStatus has also been updated to include its type name
like the other two status providers. Now all follow the pattern
Type(Field=Value,Field2=Value...)
@HarleyRossetto HarleyRossetto force-pushed the add-labels-to-ToString branch from ad283f7 to 888887f Compare April 10, 2026 13:59
@jsonbailey jsonbailey changed the title fix: make Status ToString() methods format consistent feat: make Status ToString() methods format consistent Apr 16, 2026
@jsonbailey jsonbailey changed the title feat: make Status ToString() methods format consistent feat: Make Status ToString() methods format consistent Apr 16, 2026
@jsonbailey jsonbailey merged commit 6373f98 into launchdarkly:main Apr 16, 2026
21 of 22 checks passed
jsonbailey pushed a commit that referenced this pull request Apr 16, 2026
🤖 I have created a release *beep* *boop*
---


##
[8.12.0](LaunchDarkly.ServerSdk-v8.11.2...LaunchDarkly.ServerSdk-v8.12.0)
(2026-04-16)


### Features

* Make Status ToString() methods format consistent
([#247](#247))
([6373f98](6373f98))

---
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**
> This is a release/versioning update
(manifest/changelog/provenance/csproj) with no functional code changes
in the diff.
> 
> **Overview**
> Bumps `pkgs/sdk/server` from `8.11.2` to `8.12.0` and updates the
release metadata accordingly.
> 
> Updates the `LaunchDarkly.ServerSdk.csproj` package version, refreshes
provenance verification docs to reference `8.12.0`, and adds the
`8.12.0` changelog entry noting the `Status.ToString()` formatting
consistency change.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
792c334. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@jsonbailey
Copy link
Copy Markdown
Contributor

@HarleyRossetto the changes have been released in LaunchDarkly.ServerSdk: v8.12.0. Thanks for the contribution.

evgenygunko pushed a commit to evgenygunko/Translations that referenced this pull request Apr 18, 2026
This PR contains the following updates:

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

---

### Release Notes

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

### [`v8.12.0`](https://github.com/launchdarkly/dotnet-core/releases/tag/LaunchDarkly.ServerSdk-v8.12.0): LaunchDarkly.ServerSdk: v8.12.0

[Compare Source](launchdarkly/dotnet-core@LaunchDarkly.ServerSdk-v8.11.2...LaunchDarkly.ServerSdk-v8.12.0)

##### Features

-   Make Status ToString() methods format consistent  ([#&#8203;247](launchdarkly/dotnet-core#247)) ([6373f98](launchdarkly/dotnet-core@6373f98))

***

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.

3 participants