lichess-org / lila

♞ lichess.org: the forever free, adless and open source chess server ♞
https://lichess.org
GNU Affero General Public License v3.0
15.77k stars 2.28k forks source link

PGN import fails if line break after White move #10816

Closed dlbbld closed 2 years ago

dlbbld commented 2 years ago

When the black move is on a new line, the PGN import stops just before this move (Analysis Board and Import Game feature):

1.e4
c5

Results in 1.e4.

1.e4 c5 2.Nf3
Nc6

Results in 1.e4 c5 2.Nf3.

1.e4 c5 2.Nf3 Nc6 3.d4
cxd4

Results in 1.e4 c5 2.Nf3 Nc6 3.d4.

Real-life example: https://www.chessgames.com/perl/nph-chesspgn?text=1&gid=1139729

ornicar commented 2 years ago

https://github.com/lichess-org/lila/issues/10815

dlbbld commented 2 years ago

When will the fix be deployed?

ornicar commented 2 years ago

tomorrow

dlbbld commented 2 years ago

Thanks, that works now. Fast fix!

On board is fine but For Tools / Import game, first, I think it did not work because it saves the imports, so it still showed the wrong results from yesterday. So I needed to delete yesterday's import first. That's quite a pitfall.

On top of it, if somebody else has already imported the PGN, I cannot delete it to correctly import. That questions a bit the usefulness of saving the import. Better would be already to compare the result of the import with the saved import and when the result is different, create a new import, to avoid such problems (created #10818).

dlbbld commented 2 years ago

For example, importing the below in Tools / Import game:

1.e4 c5 2.Nf3 Nc6 3.d4
cxd4

still results in 1.e4 c5 2.Nf3 Nc6 3.d4 as I still have one old import from yesterday (https://lichess.org/CxeYSWGr).

Only when amending the PGN by adding some tags for example, so it creates a new import entry, the result is correct

[Site "Some random string"]
1.e4 c5 2.Nf3 Nc6 3.d4
cxd4

Results correctly in 1.e4 c5 2.Nf3 Nc6 3.d4 cxd4