Skip to content

feat: Test that an override file with a deleted entry fails the reload - #599

Merged
kinyoklion merged 1 commit into
v3from
rlamb/overrides-deleted-entries
Nov 16, 2026
Merged

kinyoklion merged 1 commit into
v3from
rlamb/overrides-deleted-entries

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

Summary

launchdarkly/sdk-specs#288 makes a flag or segment marked as deleted invalid in an override snapshot and in an override file: Requirements 1.1.1.1, 1.2.8.1 and 1.3.6.2. A file that contains one fails the reload in the same way as a malformed file, so the last good overrides stay in effect. Before this change, the SDKs did five different things with such an entry, and no contract test used one.

The hot reload group of the flag overrides suite gains four tests, which run in both watching and polling mode:

  • file with a deleted flag retains last good overrides
  • file with a deleted segment retains last good overrides
  • file with a deleted flag at startup supplies no overrides until it is corrected
  • file with a deleted segment at startup supplies no overrides until it is corrected

Each file that holds a deleted entry also changes the override of the evaluated flag. An SDK that dropped only the deleted entry, instead of discarding the reload, would serve the changed value and fail the test.

The startup tests correct the file afterwards and wait for the correction to take effect. A source that stops after a failed initial load fails them.

An entry with "deleted": false is an ordinary definition. Every full-flag override in the suite already carries that property, because the harness model serializes it, so no new test covers it.

Results

The flag overrides suite, run against each test service:

Test service Result
go-server-sdk v7 all 8 new tests fail: the SDK applies the file and serves the changed value
go-server-sdk launchdarkly/go-server-sdk#510 88 ran, all passed
js-core launchdarkly/js-core#2187 73 ran, all passed
java-core launchdarkly/java-core#259 48 ran, all passed (the test service has no listener capabilities)
dotnet-core launchdarkly/dotnet-core#404 88 ran, all passed
python-server-sdk launchdarkly/python-server-sdk#574, sync and async services 88 ran on each, all passed
ruby-server-sdk launchdarkly/ruby-server-sdk#493 88 ran, all passed

All 8 new tests ran on every service; none was skipped.

Related issues

  • launchdarkly/sdk-specs#288

Opened from termag

SDK-3578


Note

Overview
Adds hot reload contract tests so override files that include a flag or segment with "deleted": true are treated like malformed reloads: the SDK must keep the last good overrides (or, at startup, serve no overrides until the file is fixed).

The suite covers deleted flags and deleted segments under both watching and polling modes, using a new docWithDeletedEntry helper that pairs a changed flagValues entry with a deleted definition so partial application is detectable.

After an invalid reload, tests confirm a subsequent valid file still applies normally.

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

A file that contains a flag or segment marked as deleted keeps the last good overrides, supplies none at startup, and takes effect once corrected. Each file also changes an override, so an SDK that drops only the deleted entry fails.
@kinyoklion

Copy link
Copy Markdown
Member Author

bugbot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit cfe421d. Configure here.

@kinyoklion
kinyoklion marked this pull request as ready for review November 12, 2026 21:27
@kinyoklion
kinyoklion requested a review from a team as a code owner November 12, 2026 21:27

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: low. Approved. Cursor Bugbot completed with no findings; Cursor Security Agent was not present. This is a narrow test-harness addition with limited blast radius.

Open in Web View Automation 

Sent by Cursor Approval Agent: SDK - Pull Request Router and Approver

@kinyoklion
kinyoklion merged commit d3c185a into v3 Nov 16, 2026
12 checks passed
@kinyoklion
kinyoklion deleted the rlamb/overrides-deleted-entries branch November 16, 2026 19:02
kinyoklion pushed a commit that referenced this pull request Nov 16, 2026
🤖 I have created a release *beep* *boop*
---


##
[3.2.0-alpha.18](v3.2.0-alpha.17...v3.2.0-alpha.18)
(2026-11-16)


### Features

* Add evaluation tests that send flag JSON exactly as written
([#642](#642))
([02262ea](02262ea))
* Add server-side event tests for tracking rules, experiments and index
events
([#643](#643))
([8270594](8270594))
* Add tests that a listener is not notified after it is unregistered
([#641](#641))
([552d6f1](552d6f1))
* Test that an override file with a deleted entry fails the reload
([#599](#599))
([d3c185a](d3c185a))


### Bug Fixes

* Check the order of client-side prerequisite feature events
([#634](#634))
([9676858](9676858))
* Decode characters outside the Basic Multilingual Plane in test service
responses
([#631](#631))
([960fb18](960fb18))
* Give the events-disabled tests an events URI so that they detect sent
events
([#639](#639))
([af47688](af47688))
* Infer typed defaults from v3 server-side flag data
([#640](#640))
([fbe1fdd](fbe1fdd))
* Make the sampling, identify and PHP header event tests check what they
are named for
([#633](#633))
([a6bc5c1](a6bc5c1))
* Make the wrapper and tags header-absence checks detect a sent header
([#632](#632))
([61d1024](61d1024))
* Name localhost in the subjectAltName of the harness TLS certificate
([#630](#630))
([b0c3778](b0c3778))
* Request the detail in the beforeEvaluation hook tests with detail
([#635](#635))
([c551622](c551622))
* Run the all-flags error reason test only on SDKs that support reasons
([#636](#636))
([7ed439e](7ed439e))
* Send only the intended flags in the large payload polling test
([#637](#637))
([0102985](0102985))
* Send the initial retry delay with the default streaming synchronizer
([#638](#638))
([afd82c3](afd82c3))

---
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]
> **Overview**
> Bumps the SDK test harness to **3.2.0-alpha.18** across
`.release-please-manifest.json`, `main.go` (`versionString`), and a new
**CHANGELOG** section for 2026-11-16.
> 
> The changelog records what ships in this alpha: **new contract tests**
for exact flag JSON in evaluation, server-side tracking/experiment/index
events, listener behavior after unregister, and override-file reload
failures; plus **test-harness fixes** around BMP decoding, TLS
`localhost` SAN, typed defaults from v3 flag data, event/header/sampling
assertions, streaming retry delay, polling payload scope, and
capability-guarded reason tests.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1486c4c. 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>
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