Commit 7db08b3
authored
chore: adds FDv2 source using composite datasource (#191)
**Requirements**
- [x] I have added test coverage for new or changed functionality
- [x] I have followed the repository's [pull request submission
guidelines](../blob/main/CONTRIBUTING.md#submitting-pull-requests)
- [ ] I have validated my changes against all supported platform
versions
Not trivially possible yet, still need to hook up more code to what
@kinyoklion has written.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Introduces FDv2 data source built from composable sources; refactors
CompositeSource to delegate-based factories with async action processing
and exhaustion/error reporting; adds extensive tests and test helpers.
>
> - **FDv2 Data Source**:
> - Add `FDv2DataSource` with initializer/synchronizer composition using
`CompositeSource`.
> - Implement action appliers: fast fallback for initializers, timed
fallback/recovery for synchronizers, and blacklist-on-success/off.
> - **CompositeSource Refactor**:
> - Replace `ISourceFactory`/`IActionApplierFactory` with delegate types
`SourceFactory` and `ActionApplierFactory`.
> - Process enqueued actions on a background thread; allow disposal
while actions are queued.
> - Report `Off` directly with optional `ErrorInfo`; emit exhaustion
error when no sources remain.
> - Build sinks via `FanOutDataSourceUpdates` and disableable tracker;
maintain current entry for blacklist/remove.
> - **APIs**:
> - Add delegates `SourceFactory` and `ActionApplierFactory`; remove
corresponding interfaces.
> - **Tests**:
> - Expand `CompositeSourceTest` for fallback, blacklist, disposal
semantics, exhaustion, and disabled-source isolation.
> - Add comprehensive `FDv2DataSourceTest` covering
initializer/synchronizer flows, failures, and edge cases.
> - Enhance `SourcesListTest` with non-circular end-of-list behavior.
> - **Test Utilities**:
> - Extend `CapturingDataSourceUpdates` to record and wait for ordered
status updates.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
370e94e. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 59616e3 commit 7db08b3
File tree
10 files changed
+1452
-138
lines changed- pkgs/sdk/server
- src/Internal
- DataSources/CompositeDataSource
- FDv2DataSources
- test
- Internal
- DataSources/CompositeDataSource
- FDv2DataSources
10 files changed
+1452
-138
lines changedLines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Lines changed: 35 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
| 11 | + | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
| |||
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
107 | | - | |
108 | 112 | | |
109 | | - | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
113 | 116 | | |
114 | 117 | | |
115 | | - | |
| 118 | + | |
116 | 119 | | |
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
124 | 129 | | |
125 | 130 | | |
126 | 131 | | |
| |||
137 | 142 | | |
138 | 143 | | |
139 | 144 | | |
140 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
141 | 148 | | |
142 | 149 | | |
143 | 150 | | |
144 | 151 | | |
145 | | - | |
| 152 | + | |
146 | 153 | | |
147 | 154 | | |
148 | 155 | | |
| |||
151 | 158 | | |
152 | 159 | | |
153 | 160 | | |
154 | | - | |
| 161 | + | |
| 162 | + | |
155 | 163 | | |
156 | 164 | | |
157 | 165 | | |
| |||
177 | 185 | | |
178 | 186 | | |
179 | 187 | | |
| 188 | + | |
180 | 189 | | |
181 | 190 | | |
182 | | - | |
183 | 191 | | |
184 | 192 | | |
185 | 193 | | |
| |||
188 | 196 | | |
189 | 197 | | |
190 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
191 | 207 | | |
192 | 208 | | |
193 | 209 | | |
194 | 210 | | |
195 | 211 | | |
196 | 212 | | |
197 | 213 | | |
198 | | - | |
| 214 | + | |
199 | 215 | | |
200 | 216 | | |
201 | 217 | | |
| |||
205 | 221 | | |
206 | 222 | | |
207 | 223 | | |
208 | | - | |
| 224 | + | |
209 | 225 | | |
210 | 226 | | |
211 | 227 | | |
| |||
Lines changed: 0 additions & 15 deletions
This file was deleted.
Lines changed: 0 additions & 21 deletions
This file was deleted.
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
0 commit comments