Zemke / tippspiel2

Multitenant betting game being initially developed for the World Cup 2018 in Russia.
11 stars 5 forks source link

DB entry competion.current is erroneously set to false #69

Closed morckx closed 6 years ago

morckx commented 6 years ago

… probably in updateCurrentCompetitionWithItsTeams cron job so that the current competition becomes unavailable.

Maybe it should be checked here:

https://github.com/Zemke/tippspiel2/blob/master/tippspiel2-spring/src/main/kotlin/com/github/zemke/tippspiel2/service/CompetitionService.kt#L28

also if the currentCurrentCompetition is not the same as the currentCompetition?

Zemke commented 6 years ago

Ohai, yeah that was un-good. Thanks for the hint, I was wondering what was causing this.

There’s this equality check which should only update the competition when there are changes. The if evaluated to true because Competition#lastUpdated differed. It then saved the competition which was derived from the DTO here and that has its Competiton#current set to false since that is the default.

I’m going to provide a fix later this evening.

morckx commented 6 years ago

Yes, exactly :) That's what I just have found out, too. Thanks.

Zemke commented 6 years ago

FYI, Competition#championBetAllowed was also reset to true.

morckx commented 6 years ago

Thanks for the hint! I noticed it, but at that time wasn't sure if was erroneously reset or wasn't set to false in the first place.