Skip to content

fix: Leave StateSince alone when a synchronizer starts - #502

Merged
beekld merged 1 commit into
bklimt/SDK-3425/unrecoverable-error-logfrom
bklimt/SDK-3425/private-condition-clock
Nov 3, 2026
Merged

beekld merged 1 commit into
bklimt/SDK-3425/unrecoverable-error-logfrom
bklimt/SDK-3425/private-condition-clock

Conversation

@beekld

@beekld beekld commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

#489 reset the public DataSourceStatus.StateSince to the current time whenever a synchronizer started, even when State didn't change, and without broadcasting the new status. StateSince is documented as the time State most recently changed. An app that measures how long the SDK has been Interrupted had its clock reset on every failover, and status listeners held a different StateSince than GetStatus().

The reset existed so that each synchronizer gets its own fallback and recovery window. The data system now records when the current synchronizer started in a private field. The fallback and recovery conditions measure from the later of that time and StateSince, so their timing is unchanged. StateSince again changes only when State changes.


Note

Overview
Stops resetting public DataSourceStatus.StateSince when a new synchronizer starts without a state change. Previously, starting the next synchronizer after failover rewrote StateSince to “now” (often without broadcasting), which broke apps timing how long the SDK stayed Interrupted and could disagree with status listeners.

Fallback and recovery timing is preserved by recording syncStartedAt when the active synchronizer starts and evaluating fallbackCond / recoveryCond against the later of StateSince and that start time inside conditionAction. restartStatusClock is removed; StateSince is updated only when State changes in maybeUpdateStatus.

A new test asserts StateSince is unchanged when the secondary synchronizer starts after the primary fails.

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

@beekld
beekld added this pull request to stack #503 November 2, 2026 21:04
@beekld
beekld marked this pull request as ready for review November 2, 2026 21:06
@beekld
beekld requested a review from a team as a code owner November 2, 2026 21:06
@beekld
beekld force-pushed the bklimt/SDK-3425/private-condition-clock branch from 9feb2a1 to 940feda Compare November 2, 2026 21:31
@beekld
beekld force-pushed the bklimt/SDK-3425/private-condition-clock branch from 940feda to 0d6372b Compare November 2, 2026 21:59
@beekld
beekld force-pushed the bklimt/SDK-3425/private-condition-clock branch from 0d6372b to 3db133f Compare November 3, 2026 00:05
@beekld
beekld force-pushed the bklimt/SDK-3425/private-condition-clock branch 2 times, most recently from b38d264 to dde139b Compare November 3, 2026 19:55
@beekld
beekld force-pushed the bklimt/SDK-3425/private-condition-clock branch from dde139b to 06f2eda Compare November 3, 2026 20:36
@beekld
beekld merged commit 823b9aa into v7 Nov 3, 2026
53 checks passed
@beekld
beekld deleted the bklimt/SDK-3425/private-condition-clock branch November 3, 2026 21:33
beekld pushed a commit that referenced this pull request Nov 6, 2026
🤖 I have created a release *beep* *boop*
---


##
[7.22.0](v7.21.2...v7.22.0)
(2026-11-06)


### Features

* Broadcast Off to FDv2 status listeners when the data system stops
([#505](#505))
([5c5b8ce](5c5b8ce))
* End an FDv1 fallback after a default TTL of one hour
([#499](#499))
([1f03a5f](1f03a5f))
* Park FDv2 synchronizers instead of retiring them on unexpected
failures
([#489](#489))
([644253a](644253a))


### Bug Fixes

* Keep data from a store that is not initialized out of override
evaluations and AllFlagsState, and report a store failure
([#491](#491))
([1005a1a](1005a1a))
* Keep the override marking when a migration flag serves an unrecognized
stage ([#492](#492))
([9f9911f](9f9911f))
* Leave StateSince alone when a synchronizer starts
([#502](#502))
([823b9aa](823b9aa))
* Make TestData ValueForAll return its value when targeting is off
([#507](#507))
([7300bc1](7300bc1))
* Park a synchronizer that reports Off or closes its results
([#500](#500))
([f6e9910](f6e9910))
* Poll the override files when they cannot be watched
([#495](#495))
([170ad3b](170ad3b))
* Prevent a full status listener from hanging Close
([#498](#498))
([9efd570](9efd570))
* Say that the data system retries after an unrecoverable HTTP error
([#501](#501))
([d4066cc](d4066cc))
* Treat a repeated override file path in a different case as a repeat on
Windows
([#494](#494))
([eeb68d3](eeb68d3))
* Warn when offline mode skips the override source
([#493](#493))
([69bbe61](69bbe61))

---
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**
> **Cuts the Go server SDK release `7.22.0` and records its notes.**
> 
> The root **`.release-please-manifest.json`** and
**`internal/version.go`** now declare **`7.22.0`** (replacing `7.21.2`).
**`CHANGELOG.md`** gains a new **`[7.22.0]`** section dated
**2026-11-06** documenting shipped work: FDv2 data-system behavior
(status **Off** broadcasts, synchronizer **parking** instead of retire,
**FDv1 fallback TTL**, **StateSince** handling, parking on
**Off**/closed results), plus multiple **bug fixes** around
uninitialized store data in overrides/**AllFlagsState**, migration
override marking, **TestData** when targeting is off, **override file**
polling/deduping on Windows, offline-mode warnings, status listener
**Close** hangs, and messaging for unrecoverable HTTP retries.
> 
> No application code changes appear in this PR; it’s version
bookkeeping and release notes only.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c763cc0. 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.

3 participants