Skip to content

6853: prevent browser freeze caused by invalid participant name in sequenceDiagram#7055

Merged
shubhamparikh2704 merged 4 commits intodevelopfrom
sequence-diagram-participant-name-parsing
Oct 13, 2025
Merged

6853: prevent browser freeze caused by invalid participant name in sequenceDiagram#7055
shubhamparikh2704 merged 4 commits intodevelopfrom
sequence-diagram-participant-name-parsing

Conversation

@darshanr0107
Copy link
Copy Markdown
Contributor

@darshanr0107 darshanr0107 commented Oct 8, 2025

📑 Summary

Fixes an issue where incorrect participant syntax in sequenceDiagram could cause the browser to hang due to excessive recursion during parsing.
Resolves #6853

📏 Design Decisions

  • Added validation for incorrect participant syntax.
  • Throw a clear console error instead of causing recursion.

📋 Tasks

Make sure you

  • 📖 have read the contribution guidelines
  • 💻 have added necessary unit/e2e tests.
  • 📓 have added documentation. Make sure MERMAID_RELEASE_VERSION is used for all new features.
  • 🦋 If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Oct 8, 2025

🦋 Changeset detected

Latest commit: 6fecb98

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
mermaid Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@netlify
Copy link
Copy Markdown

netlify Bot commented Oct 8, 2025

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit 6fecb98
🔍 Latest deploy log https://app.netlify.com/projects/mermaid-js/deploys/68e754477e27b60008532c3b
😎 Deploy Preview https://deploy-preview-7055--mermaid-js.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Oct 8, 2025

Open in StackBlitz

@mermaid-js/examples

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/examples@7055

mermaid

npm i https://pkg.pr.new/mermaid-js/mermaid@7055

@mermaid-js/layout-elk

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-elk@7055

@mermaid-js/layout-tidy-tree

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/layout-tidy-tree@7055

@mermaid-js/mermaid-zenuml

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/mermaid-zenuml@7055

@mermaid-js/parser

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/parser@7055

@mermaid-js/tiny

npm i https://pkg.pr.new/mermaid-js/mermaid/@mermaid-js/tiny@7055

commit: 6fecb98

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.55%. Comparing base (c1c14e4) to head (6fecb98).
⚠️ Report is 17 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #7055   +/-   ##
=======================================
  Coverage     3.55%   3.55%           
=======================================
  Files          473     473           
  Lines        47454   47454           
  Branches       730     730           
=======================================
  Hits          1687    1687           
  Misses       45767   45767           
Flag Coverage Δ
unit 3.55% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
Copy link
Copy Markdown
Member

@sidharthv96 sidharthv96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a regex guru, if it works and don't break other tests, looks good to me. 😬

@argos-ci
Copy link
Copy Markdown

argos-ci Bot commented Oct 8, 2025

The latest updates on your projects. Learn more about Argos notifications ↗︎

Build Status Details Updated (UTC)
default (Inspect) ✅ No changes detected - Oct 9, 2025, 6:31 AM

Comment thread packages/mermaid/src/diagrams/sequence/parser/sequenceDiagram.jison Outdated
Co-authored-by: omkarht <omkar@mermaidchart.com>
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
@shubhamparikh2704 shubhamparikh2704 added this pull request to the merge queue Oct 13, 2025
Merged via the queue into develop with commit a6276da Oct 13, 2025
26 checks passed
@shubhamparikh2704 shubhamparikh2704 deleted the sequence-diagram-participant-name-parsing branch October 13, 2025 13:23
This was referenced Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

InternalError: too much recursion when adding a participant in a sequenceDiagram

4 participants