Giter Club home page Giter Club logo

Comments (3)

lenguyenthanh avatar lenguyenthanh commented on July 1, 2024

mm, this is interesting as the mentioned dependency bump shouldn't change any semantic of our code. They did some optimization over traverse but that's it. I'll take a look tomorrow.

from lila.

tors42 avatar tors42 commented on July 1, 2024

Adding better example, with 8 games with players named from 1-8, to "guarantee" always hitting the problem.

Note,
after the games have been created, they are always exported in the same order.
I.e multiple exports always show the same order.

2.10.0 happens to create them in the order they show up from the pushed PGN.
2.12.0 creation order seems random.

reproducer with 8 games instead of 2
//> using scala 3.5.0-RC1
//> using dep io.github.tors42:chariot:0.1.1

@main
def main() =

  val lichessApi = "http://localhost:8080"
  val token      = "lip_yulia"

  val client = chariot.Client.basic(conf => conf.api(lichessApi))
    .withToken(token)

  val broadcast = client.broadcasts().create(p => p
    .name("Broadcast Name")
    .shortDescription("Short Broadcast Description")
    .longDescription("Looooong Broadcast Description")).get()

  val roundId = client.broadcasts().createRound(broadcast.id(),
    p => p.name("Round Name")).get().id()


  val pgnToPush = """
    [White "W 1"]
    [Black "B 1"]

    1. a4 *

    [White "W 2"]
    [Black "B 2"]

    1. b4 *

    [White "W 3"]
    [Black "B 3"]

    1. c4 *

    [White "W 4"]
    [Black "B 4"]

    1. d4 *

    [White "W 5"]
    [Black "B 5"]

    1. e4 *

    [White "W 6"]
    [Black "B 6"]

    1. f4 *

    [White "W 7"]
    [Black "B 7"]

    1. g4 *

    [White "W 8"]
    [Black "B 8"]

    1. h4 *
    """.stripIndent()

  client.broadcasts().pushPgnByRoundId(roundId, pgnToPush)

  println(String.join("\n", client.broadcasts().exportPgn(broadcast.id()).stream().map(_.toString).toList()))
2.10.0
$ scala PushPgn.scala
[Event "Round Name: W 1 - B 1"]
[Site "http://localhost:8080/study/jnE9hG4b/b6MZHcxi"]
[White "W 1"]
[Black "B 1"]
[Result "*"]
[Variant "Standard"]
[ECO "A00"]
[Opening "Ware Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/jnE9hG4b"]
[UTCDate "2024.06.02"]
[UTCTime "09:53:28"]

1. a4 *
[Event "Round Name: W 2 - B 2"]
[Site "http://localhost:8080/study/jnE9hG4b/E3FFdS49"]
[White "W 2"]
[Black "B 2"]
[Result "*"]
[Variant "Standard"]
[ECO "A00"]
[Opening "Polish Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/jnE9hG4b"]
[UTCDate "2024.06.02"]
[UTCTime "09:53:28"]

1. b4 *
[Event "Round Name: W 3 - B 3"]
[Site "http://localhost:8080/study/jnE9hG4b/48YS0xPf"]
[White "W 3"]
[Black "B 3"]
[Result "*"]
[Variant "Standard"]
[ECO "A10"]
[Opening "English Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/jnE9hG4b"]
[UTCDate "2024.06.02"]
[UTCTime "09:53:28"]

1. c4 *
[Event "Round Name: W 4 - B 4"]
[Site "http://localhost:8080/study/jnE9hG4b/iobYmbSm"]
[White "W 4"]
[Black "B 4"]
[Result "*"]
[Variant "Standard"]
[ECO "A40"]
[Opening "Queen's Pawn Game"]
[Annotator "http://localhost:8080/broadcast/-/-/jnE9hG4b"]
[UTCDate "2024.06.02"]
[UTCTime "09:53:28"]

1. d4 *
[Event "Round Name: W 5 - B 5"]
[Site "http://localhost:8080/study/jnE9hG4b/i9O50wfT"]
[White "W 5"]
[Black "B 5"]
[Result "*"]
[Variant "Standard"]
[ECO "B00"]
[Opening "King's Pawn Game"]
[Annotator "http://localhost:8080/broadcast/-/-/jnE9hG4b"]
[UTCDate "2024.06.02"]
[UTCTime "09:53:28"]

1. e4 *
[Event "Round Name: W 6 - B 6"]
[Site "http://localhost:8080/study/jnE9hG4b/oyYpIOQ1"]
[White "W 6"]
[Black "B 6"]
[Result "*"]
[Variant "Standard"]
[ECO "A02"]
[Opening "Bird Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/jnE9hG4b"]
[UTCDate "2024.06.02"]
[UTCTime "09:53:28"]

1. f4 *
[Event "Round Name: W 7 - B 7"]
[Site "http://localhost:8080/study/jnE9hG4b/gD6p2uXd"]
[White "W 7"]
[Black "B 7"]
[Result "*"]
[Variant "Standard"]
[ECO "A00"]
[Opening "Grob Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/jnE9hG4b"]
[UTCDate "2024.06.02"]
[UTCTime "09:53:28"]

1. g4 *
[Event "Round Name: W 8 - B 8"]
[Site "http://localhost:8080/study/jnE9hG4b/FAP7zDKg"]
[White "W 8"]
[Black "B 8"]
[Result "*"]
[Variant "Standard"]
[ECO "A00"]
[Opening "Kádas Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/jnE9hG4b"]
[UTCDate "2024.06.02"]
[UTCTime "09:53:28"]

1. h4 *
2.12.0
$ scala PushPgn.scala
[Event "Round Name: W 2 - B 2"]
[Site "http://localhost:8080/study/Myhlfxkj/fnWIT7rM"]
[White "W 2"]
[Black "B 2"]
[Result "*"]
[Variant "Standard"]
[ECO "A00"]
[Opening "Polish Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/Myhlfxkj"]
[UTCDate "2024.06.02"]
[UTCTime "09:58:27"]

1. b4 *
[Event "Round Name: W 4 - B 4"]
[Site "http://localhost:8080/study/Myhlfxkj/QqHuSHWj"]
[White "W 4"]
[Black "B 4"]
[Result "*"]
[Variant "Standard"]
[ECO "A40"]
[Opening "Queen's Pawn Game"]
[Annotator "http://localhost:8080/broadcast/-/-/Myhlfxkj"]
[UTCDate "2024.06.02"]
[UTCTime "09:58:27"]

1. d4 *
[Event "Round Name: W 5 - B 5"]
[Site "http://localhost:8080/study/Myhlfxkj/w5mkJREf"]
[White "W 5"]
[Black "B 5"]
[Result "*"]
[Variant "Standard"]
[ECO "B00"]
[Opening "King's Pawn Game"]
[Annotator "http://localhost:8080/broadcast/-/-/Myhlfxkj"]
[UTCDate "2024.06.02"]
[UTCTime "09:58:27"]

1. e4 *
[Event "Round Name: W 6 - B 6"]
[Site "http://localhost:8080/study/Myhlfxkj/VsrtDUGO"]
[White "W 6"]
[Black "B 6"]
[Result "*"]
[Variant "Standard"]
[ECO "A02"]
[Opening "Bird Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/Myhlfxkj"]
[UTCDate "2024.06.02"]
[UTCTime "09:58:27"]

1. f4 *
[Event "Round Name: W 7 - B 7"]
[Site "http://localhost:8080/study/Myhlfxkj/hNqHAmLZ"]
[White "W 7"]
[Black "B 7"]
[Result "*"]
[Variant "Standard"]
[ECO "A00"]
[Opening "Grob Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/Myhlfxkj"]
[UTCDate "2024.06.02"]
[UTCTime "09:58:27"]

1. g4 *
[Event "Round Name: W 1 - B 1"]
[Site "http://localhost:8080/study/Myhlfxkj/cURy4adM"]
[White "W 1"]
[Black "B 1"]
[Result "*"]
[Variant "Standard"]
[ECO "A00"]
[Opening "Ware Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/Myhlfxkj"]
[UTCDate "2024.06.02"]
[UTCTime "09:58:27"]

1. a4 *
[Event "Round Name: W 3 - B 3"]
[Site "http://localhost:8080/study/Myhlfxkj/5NZXuBte"]
[White "W 3"]
[Black "B 3"]
[Result "*"]
[Variant "Standard"]
[ECO "A10"]
[Opening "English Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/Myhlfxkj"]
[UTCDate "2024.06.02"]
[UTCTime "09:58:27"]

1. c4 *
[Event "Round Name: W 8 - B 8"]
[Site "http://localhost:8080/study/Myhlfxkj/OYshvMo5"]
[White "W 8"]
[Black "B 8"]
[Result "*"]
[Variant "Standard"]
[ECO "A00"]
[Opening "Kádas Opening"]
[Annotator "http://localhost:8080/broadcast/-/-/Myhlfxkj"]
[UTCDate "2024.06.02"]
[UTCTime "09:58:27"]

1. h4 *

from lila.

tors42 avatar tors42 commented on July 1, 2024

This seems fixed by 8b0a762

from lila.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.