# Bug OP-18090 - Apiv3: Missing preload in /api/v3/time_entries

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-18090

## Open points

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Module | Modules and project features / Time tracking, API |
| Target versions | 16.6.0 |
| Observed in versions | 16.3.0 |
| Sprint | 16.6.0 |
| Backlog bucket |  |
| Bug found in version (deprecated) | 16.3.x |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Requires doc change | No |
| Accessibility | No |
| Pull preview |  |
| List |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Jan Sandbrink |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Planning

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

## Costs

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

## Description

### Steps to reproduce

1.  Be on an OpenProject instance with a large amount of time entries

2.  Call `/api/v3/time_entries`

3.  Watch the Active Record server logs

### What is the buggy behavior?

An N+1 query on the work\_packages table is happening, slowing down the response.

### What is the expected behavior?

No N+1 query.

### QA notes

I don't think that the fix can be properly tested, just by looking at the behaviour of the API. If you want to test that nothing else got broken, feel free to do so.

Otherwise immediately closing this WP, might also be an option.
