lmika / goseq

A command line tool to generate sequence diagrams
https://goseq.lmika.dev
MIT License
205 stars 26 forks source link

Bug in nested ALT with self referencing #16

Closed NikolaiLaptevTR closed 3 years ago

NikolaiLaptevTR commented 3 years ago

This code display nesting normally

participant User
participant API
participant Database (icon="cylinder")

alt: [client is ready]
    API->Database: Send message
    alt: [client has ip address]
        API->Database: Send message2
    end
end

But when we replace API->Database: Send message2 with API->API: Send message2, nested ALT become bigger than its parent ALT. All code to reproduce a bug:

participant User
participant API
participant Database (icon="cylinder")

alt: [client is ready]
    API->Database: Send message
    alt: [client has ip address]
        API->API: Send message2
    end
end
lmika commented 3 years ago

Thanks for the report. I will look into it.

lmika commented 3 years ago

Just to make sure we're seeing the same thing, here is what was produced when I executed the diagrams from the latest version on master:

First diagram:

out1

Second diagram:

out2

Is this what you're seeing as well?

lmika commented 3 years ago

Ah, I see the problem. This bug may have already been fixed as part of issue #11. I will cut a new release containing the bug fix. Once that's done, please check it out and see whether the issue persists.

NikolaiLaptevTR commented 3 years ago

Thanks for a quick update. The second diagram for me contains nested ALT covering User line and it crosses its parent ALT. What you shared on a picture is what I would love it to be :-)

lmika commented 3 years ago

Thanks, @NikolaiLaptevTR . May I suggest trying out version 0.0.2. This should have the fix in place.

NikolaiLaptevTR commented 3 years ago

@lmika works great. Thank you very much.

lmika commented 3 years ago

No problem. Thanks for the report.