github_pr_tree icon indicating copy to clipboard operation
github_pr_tree copied to clipboard

calculateTree() runs forever if PR has 1000+ files

Open regosen opened this issue 5 years ago • 5 comments

In index.tsx calculateTree() you parseInt the contents of files_tab_counter, but GitHub formats it with a comma (e.g. 1024 -> "1,024"), so parseInt returns the value before the first comma.

As a result, count is always greater than fileCount and we retrigger calculateTree over and over again:

    if (fileCount !== count) {
      setTimeout(this.calculateTree.bind(this), 100)
    }

regosen avatar Dec 10 '20 02:12 regosen

Hi @regosen - thanks for reporting. Can you provide a public link to such a PR?

berzniz avatar Dec 13 '20 19:12 berzniz

Hi @berzniz - I haven't been able to find such a public PR yet unfortunately... only private ones.

regosen avatar Dec 19 '20 18:12 regosen

That being said, here's a commit with over 1000 additions/deletions, showing how GitHub formats such numbers:

https://github.com/kubernetes/kubernetes/commit/4bf2ef646f5937c2d6eb49093fad15cfe65e7aae

regosen avatar Dec 20 '20 21:12 regosen

Thanks @regosen

berzniz avatar Dec 21 '20 12:12 berzniz

Oh, do you need a PR that touches a thousand files? https://github.com/MovingBlocks/Terasology/pull/4622/files

keturn avatar May 05 '21 05:05 keturn