Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

chore: handle legacy workspace setting

stevene16546f80aee
diff --git a/server/router/api/v1/memo_resource_service.go b/server/router/api/v1/memo_resource_service.go
index 258c3a98d..07e8e9e3e 100644
--- a/server/router/api/v1/memo_resource_service.go
+++ b/server/router/api/v1/memo_resource_service.go
@@ -73,7 +73,7 @@ func (s *APIV1Service) ListMemoResources(ctx context.Context, request *v1pb.List
MemoID: &id,
})
if err != nil {
- return nil, status.Errorf(codes.Internal, "failed to list resources")
+ return nil, status.Errorf(codes.Internal, "failed to list resources: %v", err)
}
response := &v1pb.ListMemoResourcesResponse{
diff --git a/store/workspace_setting.go b/store/workspace_setting.go
index d1f91d948..c34bb3286 100644
--- a/store/workspace_setting.go
+++ b/store/workspace_setting.go
@@ -69,6 +69,9 @@ func (s *Store) ListWorkspaceSettings(ctx context.Context, find *FindWorkspaceSe
if err != nil {
return nil, errors.Wrap(err, "Failed to convert workspace setting")
}
+ if workspaceSetting == nil {
+ continue
+ }
s.workspaceSettingCache.Store(workspaceSetting.Key.String(), workspaceSetting)
workspaceSettings = append(workspaceSettings, workspaceSetting)
}
@@ -206,7 +209,8 @@ func convertWorkspaceSettingFromRaw(workspaceSettingRaw *WorkspaceSetting) (*sto
}
workspaceSetting.Value = &storepb.WorkspaceSetting_MemoRelatedSetting{MemoRelatedSetting: memoRelatedSetting}
default:
- return nil, errors.Errorf("unsupported workspace setting key: %v", workspaceSettingRaw.Name)
+ // Skip unsupported workspace setting key.
+ return nil, nil
}
return workspaceSetting, nil
}