-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(server/v2): refactor the server/v2 events #21785
Changes from all commits
895cf04
8596f3d
7bc777b
9b221e8
dc2ab6d
4ca72d0
715bad1
466d799
1232713
dd9b219
e59ee1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,7 +67,7 @@ type moduleDecoder struct { | |
collectionLookup *btree.Map[string, *collectionSchemaCodec] | ||
} | ||
|
||
func (m moduleDecoder) decodeKV(update schema.KVPairUpdate) ([]schema.ObjectUpdate, error) { | ||
func (m moduleDecoder) decodeKV(update schema.KVPairUpdate) ([]schema.StateObjectUpdate, error) { | ||
key := update.Key | ||
ks := string(key) | ||
var cd *collectionSchemaCodec | ||
|
@@ -87,32 +87,32 @@ func (m moduleDecoder) decodeKV(update schema.KVPairUpdate) ([]schema.ObjectUpda | |
return cd.decodeKVPair(update) | ||
} | ||
|
||
func (c collectionSchemaCodec) decodeKVPair(update schema.KVPairUpdate) ([]schema.ObjectUpdate, error) { | ||
func (c collectionSchemaCodec) decodeKVPair(update schema.KVPairUpdate) ([]schema.StateObjectUpdate, error) { | ||
// strip prefix | ||
key := update.Key | ||
key = key[len(c.coll.GetPrefix()):] | ||
|
||
k, err := c.keyDecoder(key) | ||
if err != nil { | ||
return []schema.ObjectUpdate{ | ||
return []schema.StateObjectUpdate{ | ||
{TypeName: c.coll.GetName()}, | ||
}, err | ||
Comment on lines
+97
to
99
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the compilation error due to undefined type The static analysis hints indicate that the type ToolsGitHub Check: tests (03)
GitHub Check: tests (02)
GitHub Check: tests (01)
GitHub Check: tests (00)
GitHub Check: dependency-review
GitHub Check: golangci-lint
|
||
} | ||
|
||
if update.Remove { | ||
return []schema.ObjectUpdate{ | ||
return []schema.StateObjectUpdate{ | ||
{TypeName: c.coll.GetName(), Key: k, Delete: true}, | ||
}, nil | ||
Comment on lines
+103
to
105
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the compilation error due to undefined type The static analysis hints indicate that the type ToolsGitHub Check: tests (03)
GitHub Check: tests (02)
GitHub Check: tests (01)
GitHub Check: tests (00)
GitHub Check: dependency-review
GitHub Check: golangci-lint
|
||
} | ||
|
||
v, err := c.valueDecoder(update.Value) | ||
if err != nil { | ||
return []schema.ObjectUpdate{ | ||
return []schema.StateObjectUpdate{ | ||
{TypeName: c.coll.GetName(), Key: k}, | ||
}, err | ||
Comment on lines
+110
to
112
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the compilation error due to undefined type The static analysis hints indicate that the type ToolsGitHub Check: tests (03)
GitHub Check: tests (02)
GitHub Check: tests (01)
GitHub Check: tests (00)
GitHub Check: dependency-review
GitHub Check: golangci-lint
|
||
} | ||
|
||
return []schema.ObjectUpdate{ | ||
return []schema.StateObjectUpdate{ | ||
{TypeName: c.coll.GetName(), Key: k, Value: v}, | ||
}, nil | ||
Comment on lines
+115
to
117
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix the compilation error due to undefined type The static analysis hints indicate that the type ToolsGitHub Check: tests (03)
GitHub Check: tests (02)
GitHub Check: tests (01)
GitHub Check: tests (00)
GitHub Check: dependency-review
GitHub Check: golangci-lint
|
||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix the undefined type
schema.StateObjectType
.The static analysis tools indicate that
schema.StateObjectType
is undefined. This change would cause compilation errors.Please ensure that
schema.StateObjectType
is properly defined and imported before using it as the type for theobjectType
field.Tools
GitHub Check: tests (03)
GitHub Check: tests (02)
GitHub Check: tests (01)
GitHub Check: tests (00)
GitHub Check: dependency-review
GitHub Check: golangci-lint