REF006: unknown-message-type
Message sent to a type no handler listens for
| Code | REF006 |
| Name | unknown-message-type |
| Category | References (REF) |
| Default severity | warning |
| Enabled by default | yes |
| Fix available | no |
| ign-lint equivalent | none |
What it does
Section titled “What it does”Checks the literal message types of script calls against the message handlers of the target project (with inheritance):
system.perspective.sendMessage(type, payload, scope): component message handlers of the project's views. When handlers of the type exist but none listens on the call's scope (pagewhen not given;session,pageorviewas a literal), that is reported too.system.util.sendMessage(project, handler, payload, scope): gateway, Perspective session and Vision client message handlers ofproject(a literal naming a project of the workspace, orsystem.util.getProjectName()); a literalscope(G,S,Cand combinations) limits the handler kinds that count.system.util.sendRequest/sendRequestAsync: gateway message handlers ofproject.
Types and projects that are not literals, projects outside the workspace and projects whose handlers may come from a parent outside the workspace are not checked. In an inheritable project a handler defined by any project inheriting from it counts.
Why is this bad?
Section titled “Why is this bad?”A message nobody handles is silently dropped (sendRequest fails with
an error). A missing handler is usually a typo in the type or a handler
that was renamed.
Example
Section titled “Example”system.perspective.sendMessage('refreshTabel', scope='session')Use instead (the handler listens for refreshTable with session scope):
system.perspective.sendMessage('refreshTable', scope='session')Generated from the rule metadata by iglint generate-docs; iglint rule REF006 prints the same page in the terminal. Source: docs/rules/REF006.md.