online-judge icon indicating copy to clipboard operation
online-judge copied to clipboard

Comment page is not changed when object code is changed

Open hieplpvip opened this issue 2 years ago • 2 comments

For example, a problem with code example will have its comments stored in page p:example. When the problem code is changed to example2, the new page would be p:example2. However, the existing comments still have page p:example. As a result, all comments are lost (until the problem is renamed back to example).

hieplpvip avatar Jan 27 '23 08:01 hieplpvip

Comments on the editorial page may also be affected

int-y1 avatar Jan 27 '23 18:01 int-y1

https://github.com/DMOJ/online-judge/blob/617a321d03756c46e62986dfe2f6db4c944a5d9a/judge/views/problem.py#L146-L147

This needs to change to use the problem ID (and solution ID, for the editorial views). We should also have a migration that ports comments over to the id-based comment keys.

Comment locks are also affected, and would also need to be migrated.

Xyene avatar Feb 05 '23 20:02 Xyene