# Bug COMMS-388 - Large amount of comments causes workpackage to freeze (missing lazy-loading and loading indicator for Activity tab)

Project: Stream Communicator
Status: closed
URL: https://community.openproject.org/work_packages/COMMS-388

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | High |
| Module | Modules and project features / Work packages, Modules and project features / Comments and activity |
| Target versions | 17.1.0 |
| Observed in versions | 16.2.0 |
| Sprint |  |
| Backlog bucket |  |
| Bug found in version (deprecated) | 16.2.x |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Kabiru Mwenja |
| Product manager |  |
| Developers | Kabiru Mwenja |
| Designer | Parimal Satyal |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

| Attribute | Value |
| --- | --- |
| Relevance |  |

## Costs

| Attribute | Value |
| --- | --- |
| Votes |  |
| Work |  |
| Labor costs |  |

## Description

### Steps to reproduce

1.  Have a workpackage with a large amount of comments (570 is mentioned as an example)

2.  Attempt to open the workpackage

### What is the buggy behavior?

  - Browser freezes/becomes unresponsive

  - Even if  - after a long wait - the page loads, it does not work well. Scrolling breaks and the  page feels unresponsive.

  - After analysis, it appears the issues comes from the large number of comments on some tasks (570+)
    
      - Browsers slow down and freeze the moment you open the view to a task
        
          - *Especially chromium-based browsers are affected*
        
          - *Especially on middle to lower end or older hardware (Intel 3rd/4th gen, faster but still noticable on 6th)*
        
          - *Firefox also slows down but wont freeze as extremely*
        
          - *Profilers pinpoint these to polyfill library and callstacks go to mutationobservers/callbacks*
            
              - *Removing the callbacks through browser-extensions like tampermonkey massively increases web performance, but breaks .. input validation and actually saving changes to backend*
        
          - *When opening tasks that aren't affected- as long as they have a referenced task with that issue, the browser still experiences significant slowdown*
        
          - *Creating new tasks and viewing or editing these works fine without performance impact*

### What is the expected behavior?

  - Workpackages with large amount of comments don't experience performance issues. We partially do this by limiting the number of comments loaded and adopting a progressive/lazy-loading approach.
    
      - Pre-load a fixed number *n* of comments/activities (50 journals?)
    
      - When you reach the the end of the loaded list, show a loading indicator ([SkeletonBox](https://qa.openproject-edge.com/lookbook/inspect/primer/alpha/skeleton_box/default), see [Figma mockup](https://www.figma.com/design/Lb7ao364ppIiPxp9ptSXkM/Activity-tab-and-Emoji?node-id=1378-6467&t=kEmXSPj3jvlc5Ydt-4) for design) and then load another *n* items.
        
          - And so on...
    
      - When loading a page with a deep-link to a comment, load *n/2* above and below the linked comment.

<img class="image_resized op-uc-image op-uc-image_inline" style="width:394px;" src="/api/v3/attachments/784063/content">

### 

### 

### Environment information

**OpenProject installation type**

  - Selfhosted, Packaged installation
    
      - Ubuntu 20.04.6 LTS

**OpenProject version**

*16.2.2*

**Browser**

- [x] Chrome
- [x] Firefox
- [ ] Safari
- [ ] Mobile Safari
- [ ] Other (please specify)

**Operating System**

- [x] Windows
- [ ] Mac OS X
- [ ] Mobile iOS
- [ ] Mobile Android
- [ ] Linux (please specify distro)
- [ ] Chrome OS
- [ ] Other (please specify)

**Language**

*English and German*
