Skip to content

Commit

Permalink
fix tour dates denormalization
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jun 30, 2024
1 parent 431b1b8 commit e09783c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/relay/src/main/RelayApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ final class RelayApi(
.aggregateOne(): framework =>
import framework.*
Match($doc("tourId" -> tourId)) -> List(
Project($doc("at" -> $doc("ifNull" -> $arr("$startsAt", "$startedAt")))),
Project($doc("at" -> $doc("$ifNull" -> $arr("$startsAt", "$startedAt")))),
Sort(Ascending("at")),
Group(BSONNull)("at" -> PushField("at")),
Project($doc("start" -> $doc("$first" -> "$at"), "end" -> $doc("$first" -> "$at")))
Project($doc("start" -> $doc("$first" -> "$at"), "end" -> $doc("$last" -> "$at")))
)
.map:
_.flatMap: doc =>
Expand Down Expand Up @@ -304,7 +304,7 @@ final class RelayApi(
_ <- roundRepo.coll.update.one($id(round.id), round).void
_ <- (round.sync.playing != from.sync.playing)
.so(sendToContributors(round.id, "relaySync", jsonView.sync(round)))
_ <- (round.stateHash != from.stateHash).so(denormalizeTour(round.tourId))
_ <- denormalizeTour(round.tourId)
yield
round.sync.log.events.lastOption
.ifTrue(round.sync.log != from.sync.log)
Expand Down

0 comments on commit e09783c

Please sign in to comment.