Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Promise rejection when filtering branch in commit graph #31376

Closed
amrsoll opened this issue Jun 14, 2024 · 9 comments · Fixed by #31377
Closed

Promise rejection when filtering branch in commit graph #31376

amrsoll opened this issue Jun 14, 2024 · 9 comments · Fixed by #31377
Labels

Comments

@amrsoll
Copy link

amrsoll commented Jun 14, 2024

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

@wxiaoguang

This comment was marked as outdated.

@wxiaoguang wxiaoguang added issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail and removed type/bug labels Jun 14, 2024
@wxiaoguang
Copy link
Contributor

Oops, it's only fixed in main(1.23) nightly, not in 1.22-nightly ....

@wxiaoguang
Copy link
Contributor

-> Fix repo graph JS #31377

@wxiaoguang wxiaoguang added type/bug and removed issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail labels Jun 14, 2024
@wxiaoguang wxiaoguang linked a pull request Jun 14, 2024 that will close this issue
silverwind pushed a commit that referenced this issue Jun 14, 2024
@wxiaoguang
Copy link
Contributor

wxiaoguang commented Jun 15, 2024

1.22-nightly with the fix is ready, could you take a try?

https://dl.gitea.com/gitea/1.22-nightly/

@amrsoll
Copy link
Author

amrsoll commented Jun 17, 2024

If you mean to ask me to test out on our system config, I am unfortunately unable because our production VM is a snowflake that I cannot easily replicate 😅 I imagine it works if you already had it fixed in an upcoming version

Thank you for the fix 🙏

@homjay

This comment was marked as off-topic.

@techknowlogick
Copy link
Member

@homjay, are you getting this on the commit graph page too, or a different page?

@techknowlogick techknowlogick added the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jul 12, 2024
@homjay
Copy link

homjay commented Jul 14, 2024

@homjay, are you getting this on the commit graph page too, or a different page?

Thanks for replying. I get this on every page.
But now I have identified this was caused by the Zotero plugin in the Safari browser.

@lunny
Copy link
Member

lunny commented Jul 14, 2024

@homjay, are you getting this on the commit graph page too, or a different page?

Thanks for replying. I get this on every page.

But now I have identified this was caused by the Zotero plugin in the Safari browser.

So I think that's a different problem. I'm going to close this one.

@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jul 17, 2024
@wxiaoguang wxiaoguang removed the issue/needs-feedback For bugs, we need more details. For features, the feature must be described in more detail label Jul 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants