Unverified Commit 3b25a6bb authored by RoccoSmit's avatar RoccoSmit Committed by GitHub

fix: handle missing reaction (#4094)

* migration version

* Updated test to match with current version set in version.go file

* updated logic to check if migration should run for fresh install

* Update test to test for version number set in version.go

* fixed test

* Revert "fixed test"

This reverts commit 4004d0e92bc16423c8c2a8c9818a9c2e4bab7fdb.

* Revert "Update test to test for version number set in version.go"

This reverts commit d304add5d673effb727c208bb26c3b0b44416e1c.

* Revert "updated logic to check if migration should run for fresh install"

This reverts commit b44dca21944b696b2839296f645f408a63c58a5d.

* Revert "Updated test to match with current version set in version.go file"

This reverts commit 3ad0d889b621a8778d5efb5a62a85386a380fac8.

* Revert "migration version"

This reverts commit b13cfc346a3c2f913ded303de5d9123aaa9e029d.

* Added default reaction if no reation found

* Fixed static check issue

* Use emoji
parent 3786fb8d
...@@ -140,6 +140,7 @@ func (s *Store) GetWorkspaceGeneralSetting(ctx context.Context) (*storepb.Worksp ...@@ -140,6 +140,7 @@ func (s *Store) GetWorkspaceGeneralSetting(ctx context.Context) (*storepb.Worksp
const ( const (
// DefaultContentLengthLimit is the default limit of content length in bytes. 8KB. // DefaultContentLengthLimit is the default limit of content length in bytes. 8KB.
DefaultContentLengthLimit = 8 * 1024 DefaultContentLengthLimit = 8 * 1024
DefaultReaction = "👍"
) )
func (s *Store) GetWorkspaceMemoRelatedSetting(ctx context.Context) (*storepb.WorkspaceMemoRelatedSetting, error) { func (s *Store) GetWorkspaceMemoRelatedSetting(ctx context.Context) (*storepb.WorkspaceMemoRelatedSetting, error) {
...@@ -157,6 +158,9 @@ func (s *Store) GetWorkspaceMemoRelatedSetting(ctx context.Context) (*storepb.Wo ...@@ -157,6 +158,9 @@ func (s *Store) GetWorkspaceMemoRelatedSetting(ctx context.Context) (*storepb.Wo
if workspaceMemoRelatedSetting.ContentLengthLimit < DefaultContentLengthLimit { if workspaceMemoRelatedSetting.ContentLengthLimit < DefaultContentLengthLimit {
workspaceMemoRelatedSetting.ContentLengthLimit = DefaultContentLengthLimit workspaceMemoRelatedSetting.ContentLengthLimit = DefaultContentLengthLimit
} }
if len(workspaceMemoRelatedSetting.Reactions) == 0 {
workspaceMemoRelatedSetting.Reactions = append(workspaceMemoRelatedSetting.Reactions, DefaultReaction)
}
s.workspaceSettingCache.Store(storepb.WorkspaceSettingKey_MEMO_RELATED.String(), &storepb.WorkspaceSetting{ s.workspaceSettingCache.Store(storepb.WorkspaceSettingKey_MEMO_RELATED.String(), &storepb.WorkspaceSetting{
Key: storepb.WorkspaceSettingKey_MEMO_RELATED, Key: storepb.WorkspaceSettingKey_MEMO_RELATED,
Value: &storepb.WorkspaceSetting_MemoRelatedSetting{MemoRelatedSetting: workspaceMemoRelatedSetting}, Value: &storepb.WorkspaceSetting_MemoRelatedSetting{MemoRelatedSetting: workspaceMemoRelatedSetting},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment