mermaid-js / mermaid

Generation of diagrams like flowcharts or sequence diagrams from text in a similar manner as markdown
https://mermaid.js.org
MIT License
71.55k stars 6.48k forks source link

Browser page hangs in live editor after changing Git branch name in Git Graph #2648

Closed glebsam closed 2 years ago

glebsam commented 2 years ago

Describe the bug Browser page hangs in live editor after changing Git branch name in Git Graph. Reproduces with both locally-deployed editor and https://mermaid.live/ After the hang the editor can be opened only in Incognito window.

To Reproduce Link to Live Editor:

Steps to reproduce the behavior:

  1. (optionally) Open an incognito window
  2. Go to live editor
  3. Click on 'Sample Diagrams' -> 'Git Graph'
  4. Try to edit a branch name

Expected behavior Branch name changed, changes can be seen on the rendered graph

Screenshots

Watch the video:

Desktop (please complete the following information):

Additional context

I think the issue is on the frontend part, because:

sidharthv96 commented 2 years ago

Discussed with @knsv, fix needs to be in core mermaid code.

ashishjain0512 commented 2 years ago

GitGrapgh is based on a new rendering engine released that does not have this issue. Closing as this issue is obsolete.

AndrewBarfield commented 2 months ago

EDIT/UPDATE: Clearing site data in chrome://settings/content/siteDetails?site=https%3A%2F%2Fmermaid.live corrects the problem ...so far.

I'm here because https://mermaid.live/ hangs chrome and I can no longer use the editor. I was editing a small Gantt chart. and the text editor froze. Since then opening the URL above causes Chrome Version 127.0.6533.119 (Official Build) (64-bit) to freeze and the computer fan to blast off.

sidharthv96 commented 2 months ago

@AndrewBarfield can you please share the chart you were using? It's usually edge conditions that trigger issues like this. So it'll help us fix the underlying bug.

You can share privately to security@mermaid.live as well.

AndrewBarfield commented 2 months ago

It was a Gantt diagram like this:

gantt
    dateFormat HH:mm
    axisFormat %H:%M
    tickInterval 1hour
    section Automation
        Vacuum Den      :00:00, 45m
        Mop Kitchen     :03:00, 30m
    section Diet
        Lemon Water     :06:00, 5m
    section Leisure
        Sleep           :00:00, 6h
        Sleep           :20:00, 4h
    section Wellness
        Walk 2 miles        :06:30, 30m
sidharthv96 commented 2 months ago

That diagram doesn't break the site, though. Maybe it was a typo that triggered the issue?