domjudge icon indicating copy to clipboard operation
domjudge copied to clipboard

Problem import message shows on wrong page

Open eldering opened this issue 2 years ago • 4 comments
trafficstars

Description of the problem

While importing problems into a new contest (from problem zip files), the message of problem id 108 showed up on the result page for problem 107, together with the message of problem 107 itself.

Your environment

DOMjudge version 8.0 running on CentOS 8

Steps to reproduce

  • Import a new contest from contest.yaml
  • Open multiple tabs for each problem after importing them from problems.yaml
  • On each tab, go to "edit" and import the problem from its zip file, into the newly created contest

This only happened once out of 12-13 problems imported, so it seems not consistently reproducible.

Expected behaviour

Each message shows on the page of that problem itself.

Actual behaviour

eldering avatar Sep 25 '23 12:09 eldering

It shows on the first page that is rendered, so this is a synchronization thing. Unless we use a separate error block for each problem (of which I don’t know the downsides) I don’t think there is much we can do

nickygerritsen avatar Sep 25 '23 12:09 nickygerritsen

Ok, indeed: now it shows on the submissions page.

I'd say it would be good to fix this. It looks really strange to see this message on a page it really doesn't belong.

eldering avatar Sep 25 '23 12:09 eldering

For this to be fixed we need to:

  • investigate which flash messages we use
  • Make sure you can only end up on one page after showing a flash message
  • Make each flash message unique
  • Change the template logic to show the correct flash

Seems doable (search for “flash” in all controllers). Just a lot of work.

Anyone interested is welcome to create a PR, otherwise I can take a look but probably only after finals since we have plenty stuff to do that seems more important.

nickygerritsen avatar Sep 25 '23 12:09 nickygerritsen

Sure. I agree this is not very important, but would be good to fix. Maybe at a hackathon or so.

eldering avatar Sep 25 '23 12:09 eldering