Repository navigation
Commit 47fec12
committed
fix: decouple diagnostics from cooldown; mirror go-sdk-events review fixes (SDK-3375)
Diagnostics are now fully out of scope for the event-delivery cooldown, matching
the Go implementation. A diagnostic delivery no longer mints a window token or
feeds the tracker; it only calibrates the clock from the Date header as before.
This removes a blackout mode a reviewer surfaced: a proxy that accepts /bulk but
rejects /diagnostic would otherwise open a new window on every periodic
diagnostic and discard analytics the service would accept. Backpressure on the
diagnostic endpoint itself belongs to the DIAG spec (SDK-2777), not here.
Mirrors the fixes made on the Go PR's human review (launchdarkly/go-sdk-events#68):
- When a window opens, forget every context key so post-window payloads
re-introduce contexts whose index/identify events were lost with the refused
batch. The window opens on a flush worker thread while the deduplicator is
only safe to touch from the dispatcher thread, so the clear is routed through
the inbox as a FLUSH_USERS message.
- A delivery failure now breaks the consecutive-success streak even when its
token is stale, so success/failure/success no longer resets the ladder across
a failure (RETRY 1.8.3). Stale outcomes still cannot open, step, or end a
window; unstamped (null) tokens remain fully inert.
- Comment trims, and the EventSender.failure() javadoc no longer claims it does
not affect the delivery schedule.
Tests updated for the window-open wipe: the three diagnostic-coupling tests
become decoupling tests (the straddle case is gone with the token), and the
dedup tests assert via index-event presence rather than exact flush counts.1 parent 8358410 commit 47fec12
5 files changed
Lines changed: 123 additions & 141 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
700 | 700 | | |
701 | 701 | | |
702 | 702 | | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
709 | 706 | | |
710 | 707 | | |
711 | 708 | | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | 709 | | |
716 | 710 | | |
717 | 711 | | |
718 | 712 | | |
719 | 713 | | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
720 | 719 | | |
721 | 720 | | |
722 | 721 | | |
| |||
731 | 730 | | |
732 | 731 | | |
733 | 732 | | |
734 | | - | |
735 | | - | |
736 | | - | |
737 | | - | |
738 | 733 | | |
739 | 734 | | |
740 | | - | |
| 735 | + | |
741 | 736 | | |
742 | 737 | | |
743 | 738 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
| 150 | + | |
155 | 151 | | |
156 | 152 | | |
157 | 153 | | |
158 | 154 | | |
159 | 155 | | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | | - | |
| 156 | + | |
166 | 157 | | |
167 | 158 | | |
168 | 159 | | |
| |||
173 | 164 | | |
174 | 165 | | |
175 | 166 | | |
176 | | - | |
177 | | - | |
178 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
179 | 170 | | |
180 | 171 | | |
181 | 172 | | |
182 | 173 | | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
183 | 181 | | |
184 | 182 | | |
185 | 183 | | |
186 | 184 | | |
187 | | - | |
188 | | - | |
| 185 | + | |
189 | 186 | | |
190 | 187 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
| 188 | + | |
| 189 | + | |
197 | 190 | | |
198 | 191 | | |
199 | 192 | | |
200 | | - | |
201 | 193 | | |
202 | 194 | | |
203 | 195 | | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
209 | 201 | | |
210 | 202 | | |
211 | | - | |
212 | | - | |
| 203 | + | |
213 | 204 | | |
214 | 205 | | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
215 | 211 | | |
216 | 212 | | |
217 | 213 | | |
218 | 214 | | |
219 | | - | |
220 | | - | |
| 215 | + | |
221 | 216 | | |
222 | | - | |
223 | 217 | | |
224 | 218 | | |
225 | 219 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
87 | | - | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
| |||
0 commit comments