RepoSense icon indicating copy to clipboard operation
RepoSense copied to clipboard

Dashboard: prevent crash due to excessive diff size

Open damithc opened this issue 6 years ago • 4 comments

When an author's contribution is beyond a certain size, we need a way to prevent the dashboard crashing if the user tries to view the code of that author.

damithc avatar Jul 17 '18 08:07 damithc

@damithc Should we impose a limit on the number of lines we can display per file? e.g. if the number of lines of a file has > 5000 lines, we show a message such as: unable to display large file > 5000 lines, please click on the [here] to view the code., where [here] links to the blame view of the file on GitHub.

jamessspanggg avatar Jul 08 '19 05:07 jamessspanggg

Yes, we can limit. If the file is bigger, we can open the code view of that file only in a separate tab? Redirecting to GitHub is not nice because the details we display is different from what GitHub displays.

damithc avatar Jul 08 '19 05:07 damithc

Hmm there might still be cases where the commits contain extremely large files as below and loading them as a single file might still not be feasible:

Screen Shot 2019-07-08 at 2 36 00 PM Screen Shot 2019-07-08 at 2 37 36 PM

Going to the blame view of these files on GitHub will also result in a non-responsive page: Screen Shot 2019-07-08 at 3 39 28 PM

jamessspanggg avatar Jul 08 '19 06:07 jamessspanggg

It's fine if an extremely large file cannot be opened but we cannot pre-determine the threshold because it depends on the user's machine. If we warn about the big file and allow the user to open it in a separate tab, if the page fails to load, the user can always kill the tab and go back without losing the entire report?

damithc avatar Jul 08 '19 08:07 damithc

Closed in view of both https://github.com/reposense/RepoSense/pull/1750 and https://github.com/reposense/RepoSense/pull/1647 being merged which puts limits on the file size being analyzed and limits on the number of characters being displayed when viewing the report which were aimed at solving a similar issue in https://github.com/reposense/RepoSense/issues/1504.

chan-j-d avatar Feb 07 '23 07:02 chan-j-d