[agent/codex:gpt-5.4-mini] Read ~/spec/code/core/go/store/RFC.md fully. Find features d... #80

Merged
Virgil merged 1 commit from agent/read---spec-code-core-go-store-rfc-md-fu into dev 2026-04-03 08:23:46 +00:00
3 changed files with 7 additions and 13 deletions

View file

@ -156,7 +156,6 @@ func newStoreFromConfig(operation string, config StoreConfig) (*Store, error) {
}
storeInstance.startBackgroundPurge()
storeInstance.cleanUpOrphanedWorkspaces(defaultWorkspaceStateDirectory)
return storeInstance, nil
}

View file

@ -159,17 +159,6 @@ func discoverOrphanWorkspacePaths(stateDirectory string) []string {
return orphanPaths
}
func (storeInstance *Store) cleanUpOrphanedWorkspaces(stateDirectory string) {
if storeInstance == nil {
return
}
for _, orphanWorkspace := range storeInstance.RecoverOrphans(stateDirectory) {
_ = orphanWorkspace.Aggregate()
orphanWorkspace.Discard()
}
}
func workspaceNameFromPath(stateDirectory, databasePath string) string {
relativePath := core.TrimPrefix(databasePath, joinPath(stateDirectory, ""))
return core.TrimSuffix(relativePath, ".duckdb")

View file

@ -184,7 +184,7 @@ func TestWorkspace_RecoverOrphans_Good(t *testing.T) {
assert.False(t, testFilesystem().Exists(workspaceFilePath(stateDirectory, "orphan-session")))
}
func TestWorkspace_New_Good_CleansUpOrphanedWorkspaces(t *testing.T) {
func TestWorkspace_New_Good_LeavesOrphanedWorkspacesForRecovery(t *testing.T) {
stateDirectory := useWorkspaceStateDirectory(t)
requireCoreOK(t, testFilesystem().EnsureDir(stateDirectory))
@ -198,6 +198,12 @@ func TestWorkspace_New_Good_CleansUpOrphanedWorkspaces(t *testing.T) {
require.NoError(t, err)
defer storeInstance.Close()
assert.True(t, testFilesystem().Exists(orphanDatabasePath))
orphans := storeInstance.RecoverOrphans(stateDirectory)
require.Len(t, orphans, 1)
assert.Equal(t, "orphan-session", orphans[0].Name())
orphans[0].Discard()
assert.False(t, testFilesystem().Exists(orphanDatabasePath))
assert.False(t, testFilesystem().Exists(orphanDatabasePath+"-wal"))
assert.False(t, testFilesystem().Exists(orphanDatabasePath+"-shm"))