Commit c210d06
authored
chore: Add support for transactional data source updates. (#189)
- Adds a new interface for transactional application of data to data
source updates.
- Handles transactional updates in DataSourceUpdatesImpl including
supporting stores which are non-tranactional. These would be from
user-store implementations, as our store implementations will be
updated.
- Updates the FDv2 streaming implementation to use this new interface.
- Removes temporary code that was used to interface from the streaming
data source to the old data source updates interface.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Adds a transactional data source updates interface and implements
end-to-end ChangeSet application (with legacy fallback), integrating
FDv2 streaming to apply changes and propagate environment ID and change
events.
>
> - **Core/SDK**:
> - Add `ITransactionalDataSourceUpdates` with
`Apply(ChangeSet<ItemDescriptor>)`.
> - Update `DataSourceUpdatesImpl` to implement transactional `Apply`:
> - Applies via `ITransactionalDataStore.Apply` when available; falls
back to legacy `Init`/`Upsert` path.
> - Sorts and processes `ChangeSet`s; updates dependency graph; computes
affected items; emits `FlagChanged` events.
> - Handles full/partial/none changesets; reports store failures and
updates `DataSourceStatus`.
> - Supports passing `EnvironmentId` to legacy stores via headers.
> - **FDv2 Integration**:
> - `FDv2ChangeSetTranslator`: convert FDv2 changes to
`ChangeSet<ItemDescriptor>`; remove old Put/Patch translators.
> - `FDv2StreamingDataSource`:
> - Require `ITransactionalDataSourceUpdates`; apply translated
`ChangeSet`s.
> - Extract `EnvironmentId` from response headers and include in
`ChangeSet`.
> - Simplify error handling and initialization flow around applies.
> - **Tests**:
> - Add/modify tests to validate transactional apply path, legacy
fallback behavior, environment ID propagation, event emission, and
error/restart logic.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
c282037. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->1 parent 12509dd commit c210d06
File tree
7 files changed
+794
-247
lines changed- pkgs/sdk/server
- src
- Internal
- DataSources
- FDv2DataSources
- Subsystems
- test
- Internal
- DataSources
- FDv2DataSources
7 files changed
+794
-247
lines changed
0 commit comments