bpmn-io / bpmn-js

A BPMN 2.0 rendering toolkit and web modeler.
https://bpmn.io/toolkit/bpmn-js/
Other
8.62k stars 1.33k forks source link

Search blows up in huge diagram #2232

Closed nikku closed 1 month ago

nikku commented 1 month ago

Describe the Bug

When I search a huge diagram then search blows up with the following error:

Uncaught TypeError: Cannot read properties of undefined (reading 'localeCompare')
    at compareStrings (BpmnSearchProvider.js:155:1)
    at eval (BpmnSearchProvider.js:72:1)
    at Array.sort (<anonymous>)
    at BpmnSearchProvider.find (BpmnSearchProvider.js:70:1)
    at SearchPad._search (SearchPad.js:186:1)
    at HTMLDivElement.eval (SearchPad.js:156:1)
    at HTMLDivElement.eval (delegate.js:35:1)

Steps to Reproduce

  1. Open huge diagram
  2. Search for a
  3. Observe error in console

Expected Behavior

Search gracefully handles search.

Environment

nikku commented 1 month ago

As this is introduced by recent changes we should fix this. Moving to ready.

philippfromme commented 1 month ago

Oh oh. I'll have a look.

philippfromme commented 1 month ago

Search blows up when getLabel returns undefined which happens with associations for example. A minimal diagram to reproduce is one with two associations:

image

barmac commented 1 month ago

I can reproduce it.

philippfromme commented 1 month ago

Fix incoming: https://github.com/bpmn-io/bpmn-js/pull/2234