Skip to content
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

Handler Codependency Bug #584

Closed
AlexWeinstein92 opened this issue Mar 8, 2024 · 2 comments · Fixed by #585
Closed

Handler Codependency Bug #584

AlexWeinstein92 opened this issue Mar 8, 2024 · 2 comments · Fixed by #585
Assignees
Labels
bug Something isn't working

Comments

@AlexWeinstein92
Copy link
Collaborator

AlexWeinstein92 commented Mar 8, 2024

See the Riddl-examples branch for riddl code related to errors

[warning] Usage: FooBarHandlerCoDependency/Foo.riddl(1:8):
Models without any streaming data will exhibit minimal effect:
domain Foo is {
       ^
[info] Info: FooBarHandlerCoDependency/Foo/foo.riddl(8:32):
Path Identifier Foo.InitialFoo in State 'InitialFooState' resolved to Record 'InitialFoo':
      state InitialFooState of Foo.InitialFoo is {
                               ^
[info] Info: FooBarHandlerCoDependency/Foo/foo.riddl(10:23):
Path Identifier FooStateChange in OnMessageClause 'On command FooStateChange' resolved to Command 'FooStateChange':
           on command FooStateChange {
                      ^
[info] Info: FooBarHandlerCoDependency/Foo/foo.riddl(11:29):
Path Identifier FooContext.Foo in OnMessageClause 'On command FooStateChange' resolved to Entity 'Foo':
              become entity FooContext.Foo to handler FooState.FinalFooState.FinalFooState
                            ^
[error] Error: FooBarHandlerCoDependency/Foo/foo.riddl(11:55):
Path 'FooState.FinalFooState.FinalFooState' was not resolved, in OnMessageClause 'On command FooStateChange'
because the PathId is invalid since it's first element, FooState, does not exist in the model
and it should refer to a Handler:
              become entity FooContext.Foo to handler FooState.FinalFooState.FinalFooState
                                                      ^
[info] Info: FooBarHandlerCoDependency/Foo/foo.riddl(15:30):
Path Identifier Foo.FinalFooState in State 'FinalFooState' resolved to Record 'FinalFooState':
      state FinalFooState of Foo.FinalFooState is {
                             ^
[info] Info: FooBarHandlerCoDependency/Foo/foo.riddl(17:23):
Path Identifier FooStateChange in OnMessageClause 'On command FooStateChange' resolved to Command 'FooStateChange':
           on command FooStateChange {
                      ^
[info] Info: FooBarHandlerCoDependency/Foo/foo.riddl(18:27):
Path Identifier FooContext.Foo in OnMessageClause 'On command FooStateChange' resolved to Entity 'Foo':
            become entity FooContext.Foo to handler FooState.InitialFooState.InitialFooState
                          ^
[error] Error: FooBarHandlerCoDependency/Foo/foo.riddl(18:53):
Path 'FooState.InitialFooState.InitialFooState' was not resolved, in OnMessageClause 'On command FooStateChange'
because the PathId is invalid since it's first element, FooState, does not exist in the model
and it should refer to a Handler:
            become entity FooContext.Foo to handler FooState.InitialFooState.InitialFooState
@reid-spencer reid-spencer added the bug Something isn't working label Mar 8, 2024
@reid-spencer reid-spencer added this to the 1.0 - First Full Release milestone Mar 8, 2024
@reid-spencer reid-spencer self-assigned this Mar 8, 2024
@reid-spencer
Copy link
Contributor

The two errors resulted from use of FooState and should have just referenced the entity, Foo.
Evan after correction, we still get:

[error] Error: riddlc/src/test/input/issues/584/Foo/foo.riddl(11:55):
Path 'Foo.FinalFooState.FinalFoo' was not resolved, in OnMessageClause 'On command FooStateChange'
because definition 'FinalFoo' was not found inside Record 'FinalFooState'
and it should refer to a Handler:
              become entity FooContext.Foo to handler Foo.FinalFooState.FinalFoo
                                                      ^

and

[error] Error: riddlc/src/test/input/issues/584/Foo/foo.riddl(18:53):
Path 'Foo.InitialFooState.FinalizeFoo' was not resolved, in OnMessageClause 'On command FooStateChange'
because definition 'FinalizeFoo' was not found inside Record 'InitialFoo'
and it should refer to a Handler:
            become entity FooContext.Foo to handler Foo.InitialFooState.FinalizeFoo
                                                    ^

@reid-spencer
Copy link
Contributor

The above messages occur because the reference to Foo.FinalFootState resolves to the record type of its data content and it never finds the handler. It also needs to search the descendants of the state and not just the record type that holds the state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants