Skip to content

[BUG]: Engine hangs awaiting getItemsByVisibility #699

Closed

Description

@ShaMan123

Describe the bug 📝

I am using the Outliner and Hider programatically.
I am not sure what is going on but perhaps if an item is hidden and I try to outline it the engine boils.
Passing them to functions such as Outliner#addItems or CameraControls#fitToItems leaves the app in a broken state. The promise never resolves.

Reproduction ▶️

Steps to reproduce 🔢

Use Outliner#addItems and Hider

This is what hangs:

const invisibleItems = new Set(await model?.getItemsByVisibility(false));

System Info 💻

n/a

Used Package Manager 📦

npm

Error Trace/Logs 📃

No response

Validations ✅

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a repository issue and not a framework-specific issue. For example, if it's a THREE.js related bug, it should likely be reported to mrdoob/threejs instead.
  • Check that this is a concrete bug. For Q&A join our Community.
  • The provided reproduction is a minimal reproducible example of the bug.

Activity

  1. added
    bug
    on Feb 20, 2026
  2. changed the title [-]Engine hangs when passing ids that do not have geometry[/-] [+]Engine hangs when passing (hidden?) ids[/+] on Feb 20, 2026
  3. changed the title [-]Engine hangs when passing (hidden?) ids[/-] [+][BUG]: Engine hangs awaiting `getItemsByVisibility`[/+] on Feb 20, 2026
  4. ShaMan123 commented on Feb 20, 2026

    @ShaMan123
    ContributorAuthor

    I can confirm that this workaround fixes the bug

    class Outliner extends BrokenOutliner {
      /**
       * work around `https://github.com/ThatOpen/engine_components/issues/699`
       */
      async update(modelIdMap = this._map) {
        if (modelIdMap === this._map) this.cleanMeshes();
        if (this.outlinePositions) this.updatePoints();
        if (Object.keys(modelIdMap).length === 0) return;
        const fragments = this.components.get(FragmentsManager);
        const renderer = this.getRenderer();
        const outlinePass = renderer.postproduction.outlinePass;
        const mesher = this.components.get(Mesher);
        const meshes = await mesher.get(modelIdMap);
        for (const modelId of Object.keys(modelIdMap)) {
          const model = fragments.list.get(modelId);
    -     const invisibleItems = new Set(await model?.getItemsByVisibility(false));
          if (!model) continue;
          for (const [_, data] of meshes.entries()) {
            for (const [localId, meshes] of data) {
    -         if (invisibleItems.has(localId)) continue;
              for (const mesh of meshes) {
                this._meshes.push(mesh);
                outlinePass.scene.add(mesh);
              }
            }
          }
        }
      }
    }
  5. agviegas commented on Feb 25, 2026

    @agviegas
    Contributor

    Fixed, will be available from @thatopen/[email protected], to be published these days. Cheers!

  6. ShaMan123 commented on Feb 26, 2026

    @ShaMan123
    ContributorAuthor

    I can confirm this has been fixed.
    However using await model.getItemsByVisibility(true) still hangs.

  7. agviegas commented on Feb 26, 2026

    @agviegas
    Contributor

    @ShaMan123 does it happen with all models? If so, feel free to open an issue. If it's just with a certain model, feel free to send it to [email protected] and I'll take a look!

  8. ShaMan123 commented on Feb 27, 2026

    @ShaMan123
    ContributorAuthor

    The IFC I sent you regarding grids causes this issue to occur. Can't reproduce with the school IFC example.
    https://stackblitz.com/edit/vitejs-vite-efp6fmgp?file=src%2FViewer.ts

  9. agviegas commented on Feb 27, 2026

    @agviegas
    Contributor

    I see, would you mind opening an issue? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions