get correct type
All checks were successful
Build and Publish / Metadata (push) Successful in 8s
Build and Publish / BuildAndDeployAmd64 (push) Successful in 1m8s
Build and Publish / BuildAndDeployArm64 (push) Successful in 3m54s

This commit is contained in:
2025-10-13 20:01:41 +02:00
parent 8e60cc2239
commit 30b98f93ce

View File

@@ -153,15 +153,14 @@ func (r *ProtoMutationRegistry) Apply(grain any, msg ...proto.Message) error {
return fmt.Errorf("nil mutation message") return fmt.Errorf("nil mutation message")
} }
for _, m := range msg {
rt := indirectType(reflect.TypeOf(msg)) rt := indirectType(reflect.TypeOf(msg))
r.mutationRegistryMu.RLock() r.mutationRegistryMu.RLock()
entry, ok := r.mutationRegistry[rt] entry, ok := r.mutationRegistry[rt]
r.mutationRegistryMu.RUnlock() r.mutationRegistryMu.RUnlock()
if !ok { if !ok {
return ErrMutationNotRegistered return ErrMutationNotRegistered
} }
for _, m := range msg {
if err := entry.Handle(grain, m); err != nil { if err := entry.Handle(grain, m); err != nil {
return err return err
} }