Skip to content

Conversation

@darshanr0107
Copy link
Contributor

@darshanr0107 darshanr0107 commented Sep 15, 2025

📑 Summary

This PR fixes a crash in Gantt chart rendering caused by an Invalid array length RangeError. The issue occurred during axis and tick calculations
Resolves #6920

📏 Design Decisions

Describe the way your implementation works or what design decisions you made if applicable.

📋 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

changeset-bot bot commented Sep 15, 2025

🦋 Changeset detected

Latest commit: d318f1a

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

netlify bot commented Sep 15, 2025

Deploy Preview for mermaid-js ready!

Name Link
🔨 Latest commit d318f1a
🔍 Latest deploy log https://app.netlify.com/projects/mermaid-js/deploys/68c7bc7aee1a150008388391
😎 Deploy Preview https://deploy-preview-6945--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.

@github-actions github-actions bot added Type: Bug / Error Something isn't working or is incorrect Sponsored by MermaidChart labels Sep 15, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 15, 2025

Open in StackBlitz

@mermaid-js/examples

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

mermaid

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

@mermaid-js/layout-elk

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

@mermaid-js/layout-tidy-tree

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

@mermaid-js/mermaid-zenuml

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

@mermaid-js/parser

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

@mermaid-js/tiny

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

commit: d318f1a

@codecov
Copy link

codecov bot commented Sep 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 3.57%. Comparing base (1c2a002) to head (d318f1a).
⚠️ Report is 15 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           develop   #6945   +/-   ##
=======================================
  Coverage     3.56%   3.57%           
=======================================
  Files          473     474    +1     
  Lines        47198   47212   +14     
  Branches       728     730    +2     
=======================================
+ Hits          1684    1687    +3     
- Misses       45514   45525   +11     
Flag Coverage Δ
unit 3.57% <100.00%> (+<0.01%) ⬆️

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

Files with missing lines Coverage Δ
packages/mermaid/src/diagrams/gantt/ganttDb.js 76.57% <100.00%> (+0.09%) ⬆️

... and 1 file with indirect coverage changes

🚀 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.

@argos-ci
Copy link

argos-ci bot commented Sep 15, 2025

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

Build Status Details Updated (UTC)
default (Inspect) 👍 Changes approved 2 added Sep 15, 2025, 7:47 AM

@darshanr0107 darshanr0107 marked this pull request as draft September 15, 2025 07:02
@darshanr0107 darshanr0107 force-pushed the fix/gantt-crash-obsidian-browser branch from dd9363d to d318f1a Compare September 15, 2025 07:12
@darshanr0107 darshanr0107 marked this pull request as ready for review September 15, 2025 07:28
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a crash in Gantt chart rendering caused by an Invalid array length RangeError when using numeric timestamps with dateFormat 'x' or 'X'. The fix adds proper handling for numeric timestamp parsing.

  • Added numeric timestamp validation and parsing for dateFormat 'x' and 'X'
  • Included comprehensive test coverage for both 'x' and 'X' dateFormat scenarios
  • Created appropriate changeset documenting the bug fix

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/mermaid/src/diagrams/gantt/ganttDb.js Adds numeric timestamp parsing logic for 'x' and 'X' dateFormats
cypress/integration/rendering/gantt.spec.js Adds test cases to verify numeric timestamp handling
.changeset/moody-fans-try.md Documents the bug fix in changeset

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@shubhamparikh2704 shubhamparikh2704 added this pull request to the merge queue Sep 16, 2025
Merged via the queue into develop with commit 216be22 Sep 16, 2025
32 of 33 checks passed
@shubhamparikh2704 shubhamparikh2704 deleted the fix/gantt-crash-obsidian-browser branch September 16, 2025 16:01
@github-actions github-actions bot mentioned this pull request Sep 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Sponsored by MermaidChart Type: Bug / Error Something isn't working or is incorrect

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gantt chart crashes obsidian and mermaid in browser

3 participants