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

Sequence Diagram Activations error #1205

Closed
securitygeneration opened this issue Jan 15, 2020 · 1 comment · Fixed by #1207
Closed

Sequence Diagram Activations error #1205

securitygeneration opened this issue Jan 15, 2020 · 1 comment · Fixed by #1207
Assignees
Labels
Graph: Sequence Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect

Comments

@securitygeneration
Copy link

Describe the bug
Deactivating an inactive Participant throws an uninformative error. With complex flows that have lots of activations and deactivations, it can be easy to get lost with which are active at any given point in time. Some indication as to which line threw the error would be useful.

To Reproduce
The following code:

sequenceDiagram
  participant user as End User
  participant Server as Server
  participant System as System
  participant System2 as System2

user->>+Server: Test
user->>+Server: Test2
user->>System: Test
Server->>-user: Test
Server->>-user: Test2

%% The following deactivation of Server will fail
Server->>-user: Test3

Produces error:

(node:7060) UnhandledPromiseRejectionWarning: Error: Evaluation failed: TypeError: Cannot read property 'starty' of undefined
    at file:///usr/local/lib/node_modules/mermaid.cli/mermaid.min.js:1:720952
    at file:///usr/local/lib/node_modules/mermaid.cli/mermaid.min.js:1:721054
    at Array.forEach (<anonymous>)
    at Object.e.draw (file:///usr/local/lib/node_modules/mermaid.cli/mermaid.min.js:1:720350)
    at Object.render (file:///usr/local/lib/node_modules/mermaid.cli/mermaid.min.js:1:760928)
    at s (file:///usr/local/lib/node_modules/mermaid.cli/mermaid.min.js:8:233)
    at Object.init (file:///usr/local/lib/node_modules/mermaid.cli/mermaid.min.js:8:318)
    at __puppeteer_evaluation_script__:17:20
    at ExecutionContext._evaluateInternal (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/ExecutionContext.js:122:13)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async ExecutionContext.evaluate (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/ExecutionContext.js:48:12)
    at async ElementHandle.evaluate (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/JSHandle.js:55:12)
    at async ElementHandle.$eval (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/JSHandle.js:478:20)
  -- ASYNC --
    at ExecutionContext.<anonymous> (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/helper.js:111:15)
    at ElementHandle.evaluate (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/JSHandle.js:55:42)
    at ElementHandle.<anonymous> (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/helper.js:112:23)
    at ElementHandle.$eval (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/JSHandle.js:478:40)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
  -- ASYNC --
    at ElementHandle.<anonymous> (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/helper.js:111:15)
    at DOMWorld.$eval (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/DOMWorld.js:156:21)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
  -- ASYNC --
    at Frame.<anonymous> (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/helper.js:111:15)
    at Page.$eval (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/Page.js:347:29)
    at Page.<anonymous> (/usr/local/lib/node_modules/mermaid.cli/node_modules/puppeteer/lib/helper.js:112:23)
    at /usr/local/lib/node_modules/mermaid.cli/index.bundle.js:83:14
    at Generator.next (<anonymous>)
    at step (/usr/local/lib/node_modules/mermaid.cli/index.bundle.js:4:191)
    at /usr/local/lib/node_modules/mermaid.cli/index.bundle.js:4:361
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:7060) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:7060) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior
A more useful error message stating possibly Invalid participant deactivation on line x

@securitygeneration securitygeneration added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Jan 15, 2020
@knsv knsv added Graph: Sequence Status: Approved Is ready to be worked on and removed Status: Triage Needs to be verified, categorized, etc labels Jan 15, 2020
@knsv
Copy link
Collaborator

knsv commented Jan 15, 2020

I can see how this could be a problem. I will take a look at this.

@knsv knsv self-assigned this Jan 15, 2020
ashishjain0512 added a commit that referenced this issue Jan 15, 2020
#1205 Adding parsing exception for then an inactive participant is inactivated
@github-actions github-actions bot locked and limited conversation to collaborators Jan 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Graph: Sequence Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants