Skip to content

Issue page: "Authors" drop-down loads ALL authors and their avatars #22586

@drsybren

Description

@drsybren

Description

The "Authors" drop-down on the repo issues page (so on the /{owner}/{repo}/issues URL) has HTML elements for all authors, and will load all of their avatars. This does not use a virtual DOM, this does not wait until the drop-down is actually opened, this happens immediately on page load.

I'm one of the Blender developers tasked with porting our data from https://developer.blender.org/ to Gitea. My local Gitea database holds 33164 users, 4 organizations, 44 repositories, 93035 issues, 731996 comments, and 749 labels. The list of "issue authors" in the Blender repository has 24919 items.

The culprit is templates/repo/issue/list.tmpl, which has this snippet in the "Authors" drop-down code:

{{range .Posters}}
	<a class="{{if eq $.PosterID .ID}}active selected{{end}} item" href="{{$.Link}}?type={{$.ViewType}}&sort={{$.SortType}}&state={{$.State}}&labels={{$.SelectLabels}}&milestone={{$.MilestoneID}}&project={{$.ProjectID}}&assignee={{$.AssigneeID}}&poster={{.ID}}">
		{{avatar .}} {{.GetDisplayName}}
	</a>
{{end}}

That .Posters list is thus 24919 items long, and it generates an <a> tag with an <img> tag for every single one of them.

You can see this on any issues page, for example https://try.gitea.io/orgddfafgsjj/rep/pulls

Screenshots

image

Gitea Version

29b78bc

Can you reproduce the bug on the Gitea demo site?

Yes

Operating System

No response

Browser Version

Firefox 109.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    performance/bigrepoPerformance Issues affecting Big Repositoriestopic/uiChange the appearance of the Gitea UItype/enhancementAn improvement of existing functionality

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions