DOMjudge / domjudge

DOMjudge programming contest jury system
https://www.domjudge.org
GNU General Public License v2.0
720 stars 254 forks source link

Additional source files sometimes not visible #175

Closed jbransen closed 8 years ago

jbransen commented 9 years ago

For submissions with multiple files, in the source code view I can sometimes only see the source code of the first file. For the other files, when I click the tab there are the 'save' and 'edit' buttons but no editor. I cannot consistently reproduce this: for the same submission sometimes after refreshing all source code tabs do show.

I did a bit of debugging: the first tab always seems to work. For the other tabs I can see that there is a <pre> element with the source code of that file, and the JS console does not show any errors. I think it may be related to the order in which tabber.js and ace.js are loaded/initialized, as it's clearly non-deterministic behaviour.

I am using DOMjudge 5.0.0 and I am now using Safari on Mac OS, but I have seen this same problem on Firefox on Ubuntu too.

eldering commented 9 years ago

How often does this happen, say, if you repeatly reload the page? Or does it keep showing fine once it does initially? Does this happen for any multi-source submission, or does it maybe depend on number or size of source files?

I cannot reproduce this (quickly) with the Java multifile test-sources, this is on Debian Jessie with Iceweasel 38.2.1 and the DOMjudge master branch.

jbransen commented 9 years ago

It also happens for 2 files that are relatively small (100 lines in first tab, 20 lines in second) too, as well as for a few more files with hundreds of lines, so size doesn't seem to be a problem. It's Java code btw.

When I repeatedly reload it seems to stay fine. In general this only seems to happen in about 10% of times I load a new source. I've now seen two new (probably related) problems:

  1. Code in first and second tab is visible and highlighted, but not in the third tab
  2. Code in second and third tab is shown but not syntax highlighted. When I click the code it is instantly highlighted.