Skip to content

Promise rejection when filtering branch in commit graph #31376

Closed
@amrsoll

Description

@amrsoll

Description

[self-hosted private Gitea 1.22]

In the commit graph, I start filtering for the master branch.

image

I sometimes get the following error, although a page refresh fixes it.

JavaScript promise rejection: un.getElementById is not a function. Open browser console to see more details.

image

In the console I get

Uncaught (in promise) TypeError: un.getElementById is not a function
    si repo-graph.js:72

image

When looking up the JS, this is the part it refers to

  const updateGraph = () => {
    const queryString = params.toString();
    const ajaxUrl = new URL(url);
    ajaxUrl.searchParams.set('div-only', 'true');
    window.history.replaceState({}, '', queryString ? `?${queryString}` : window.location.pathname);
    document.getElementById('pagination').innerHTML = '';
    hideElem('#rel-container');
    hideElem('#rev-container');
    showElem('#loading-indicator');
    (async () => {
      const response = await GET(String(ajaxUrl));
      const html = await response.text();
      const div = document.createElement('div');
      div.innerHTML = html;
*FAIL* document.getElementById('pagination').innerHTML = div.getElementById('pagination').innerHTML;
      document.getElementById('rel-container').innerHTML = div.getElementById('rel-container').innerHTML;
      document.getElementById('rev-container').innerHTML = div.getElementById('rev-container').innerHTML;
      hideElem('#loading-indicator');
      showElem('#rel-container');
      showElem('#rev-container');
    })();
  };

Gitea Version

1.22.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Debian

How are you running Gitea?

Self hosted, running on the host debian system (a VM, not a container), using the pre-built binaries from official release

Database

MySQL/MariaDB

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions