Skip to content

Commit b6dc784

Browse files
feat(Common/Storage): Add bulk storage methods for state sync
Added `GetAllStorage` and `SetAllStorage` methods to the `StorageProvider` trait in `Common`. This change: 1. **Enables User Data Sync workflow** by allowing bulk retrieval and overwrite of entire storage state (global/workspace scope) 2. **Aligns with `Mountain`'s state management** where `AppState` will implement these for persistent storage operations 3. **Supports `Cocoon` extension host** by providing efficient state transfer for VS Code extension APIs 4. **Facilitates `Wind` UI services** for settings/profile synchronization features 5. **Defines DTOs using `Value` type** consistent with Land's serialization strategy BREAKING CHANGE: All `StorageProvider` implementors (e.g. `Mountain`) must now provide implementations for the new bulk methods.
1 parent d7f8117 commit b6dc784

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Source/Storage/StorageProvider.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,10 @@ pub trait StorageProvider: Environment + Send + Sync {
4343
Key:String,
4444
ValueToSet:Option<Value>,
4545
) -> Result<(), CommonError>;
46+
47+
/// Retrieves the entire storage state for a given scope.
48+
async fn GetAllStorage(&self, IsGlobalScope:bool) -> Result<Value, CommonError>;
49+
50+
/// Overwrites the entire storage state for a given scope with a new state.
51+
async fn SetAllStorage(&self, IsGlobalScope:bool, FullState:Value) -> Result<(), CommonError>;
4652
}

0 commit comments

Comments
 (0)