Commit Graph

16083 Commits (skip-glicko-obvious)

Author SHA1 Message Date
Thibault Duplessis 64ebba75c7 skip glicko calculation when the game result is obvious 2021-09-30 14:51:49 +02:00
Thibault Duplessis 0247686705 better truncate message in notification - closes #9887 2021-09-30 09:31:06 +02:00
Thibault Duplessis 149c365521
Merge pull request #9894 from rglbr/clear_notifications
allow users to clear notifications
2021-09-29 16:05:55 +02:00
Thibault Duplessis 607e47252d simplify PerfStat streaks, remove extra arg, rename functions
after #9872
2021-09-29 09:46:56 +02:00
G-Lorenz 1dc508f975
Bugfix in PlayStreak (#9872)
Bug: the first game of a new streak is not counted in the streak,
neither in `games played in a row` nor in `max time spent playing`. Bug
is not present if the game is the first one ever under that time
control.
Steps to reproduce: play one rated game using a time control previously
used (e.g. blitz) even though not in the last hour, than go to
`lichess.org/@/<user>/perf/blitz` and note
that both `current streak` at the bottom of the page are still zero.
From the second game the `current streak` of `games played in a row` is
systematically one less than expected, while the other one does not
count the elapsed time of the first game.

Troubleshooting: the bug is due to the call at `Streak.init`
(i.e. `(0, none, none)`) when a game is discontinued from the previous one.
I propose, with this commit, to substitute that call with a new function
inspired by `inc`. This new function is called `res` (from `reset`):
its aim is to set `nb` and `time` dynamically after the first game
of the new streak.
In order to use this new function only in `nb` and `time`
I create a new `apply` function in `Streaks` and `Streak` with an extra
parameter: the reset (`r`) value. w/l streaks still use the old
`apply` function.
2021-09-29 09:37:26 +02:00
Ragul Balaji Ravichandran 0f3ff8334c restrict initial fen to variants with custom start position 2021-09-29 09:37:11 +05:30
Ragul Balaji Ravichandran 5a20e3e7c4 remove default initial fen 2021-09-28 22:01:39 +05:30
Thibault Duplessis 004f383d5c maximum 1000 forbidden pairings in a swiss tournament 2021-09-28 17:46:23 +02:00
Thibault Duplessis 4bc846816e update lame names - closes #9897 2021-09-28 16:52:25 +02:00
Thibault Duplessis 82a6c13bf9 show post with incremented views 2021-09-28 14:06:45 +02:00
Thibault Duplessis 70a3f59b55 tweak cached paginators 2021-09-28 12:13:56 +02:00
Thibault Duplessis c38af23730 do not count all finished hourly tournaments 2021-09-28 11:48:08 +02:00
Thibault Duplessis 53a3a397e7 remove latex from markdown editor, it breaks it 2021-09-28 08:44:39 +02:00
Thibault Duplessis d659e5e3ba broadcast round stream API event on tag update 2021-09-28 08:15:19 +02:00
Ragul Balaji Ravichandran 15b4ce99c7 allow users to clear notifications 2021-09-26 20:40:54 +05:30
Thibault Duplessis f58e5161bc
Merge pull request #9877 from 370417/escape-links
Call the unescapeUnderscoreInLinks function
2021-09-24 09:53:49 +02:00
Thibault Duplessis 5642398eb6 optimize /inbox msg fetch query
There can be very slow queries when these conditions are met:
- two users have thousands of msgs in their convo
- a user has deleted all the messages
- some new messages were posted, less than 100 of them, say 50
- the user who deleted the thousands of messages loads the convo

What happens then is that lila fetches 100 messages for that user,
that have not been deleted by that user.
The query will find the latest 50 non-deleted messages,
then will look for more, and ends up scanning the thousands
of deleted messages. In vain: since messages can only be deleted
up to a point in time. There can't be non-deleted messages older
than a deleted message.

So, we removed the non-deleted condition from the query. We now
just fetch the last 100 messages (with possible skip for pagination),
deleted or not. And we filter them in lila after the fetch.

This guarantees that the DB will no longer scan thousands of
deleted messages.
2021-09-24 09:31:38 +02:00
Thibault Duplessis 8961e18799
Merge pull request #9874 from kraktus/team_forum_topic_c
Fix topic count
2021-09-24 08:08:35 +02:00
Albert Ford b20f70248c
Call the unescapeUnderscoreInLinks function 2021-09-23 22:56:35 -07:00
kraktus 0c30d292af fix topic count for troll users 2021-09-23 23:33:19 +02:00
Thibault Duplessis 7983f75234 fix challenge accept API endpoint when challenge was canceled 2021-09-23 22:35:44 +02:00
kraktus 563fbbfebe Categ: Only increment number of topics for the first message of it
Close https://github.com/ornicar/lila/issues/6772
2021-09-23 22:30:29 +02:00
Thibault Duplessis f0dccc156f no multiline in chats, thx 2021-09-23 17:45:06 +02:00
Thibault Duplessis 913fa06d86 show swiss chats instead of self-moderated simul chats in mod view 2021-09-23 17:20:07 +02:00
Thibault Duplessis a42717d2d5 fix round preset 2021-09-23 14:02:52 +02:00
Thibault Duplessis 443e27caef make spectator system messages volatile, prepare player message expiration 2021-09-23 12:32:20 +02:00
Thibault Duplessis 63c22ae53c remove superfluous monitoring endpoints 2021-09-23 10:47:44 +02:00
Thibault Duplessis 9aef32ee88 broadcast streaming API 2021-09-23 10:18:10 +02:00
kraktus c8e0571b70
Fix the tournament names after translating (#9866)
* Revert "Revert "Improve tournament names translation""

This reverts commit ec10605e20.

* Fix tournament names when `Speed` different from `Perf`

Only `Rapid` and `Classical` are concerned by translation anyway.
8a1a7396f5/modules/rating/src/main/PerfType.scala (L297)

Co-authored-by: kraktus <kraktus@users.noreply.github.com>
2021-09-23 07:44:31 +02:00
Thibault Duplessis 3e529ca65d let closed accounts export their studies 2021-09-22 22:15:34 +02:00
Thibault Duplessis f9f08662c7
Merge pull request #9863 from kraktus/trans_unused3
Remove legacy translation key
2021-09-22 22:04:45 +02:00
Thibault Duplessis c1df377162 detect more garbage chars 2021-09-22 21:54:50 +02:00
kraktus bd2e265433 Remove more legacy key 2021-09-22 21:53:00 +02:00
Thibault Duplessis 15cd13d775 swiss tournament forfeit on ToS violation 2021-09-22 21:18:07 +02:00
Thibault Duplessis ec10605e20
Revert "Improve tournament names translation" 2021-09-22 19:57:20 +02:00
kraktus 845671979b Remove legacy translation keys 2021-09-22 19:10:26 +02:00
Thibault Duplessis 38b5e65a86 fix default tournament.berserkable flag in API create endpoint 2021-09-22 08:21:46 +02:00
Thibault Duplessis fe01a52440 remove ranking read preferences 2021-09-22 08:02:22 +02:00
Thibault Duplessis 0bbfce39be tweak ublog ranking 2021-09-22 07:44:00 +02:00
Thibault Duplessis 5fbb9734be
Merge pull request #9852 from kraktus/tournaments_trans
Improve tournament names translation
2021-09-21 21:34:00 +02:00
Thibault Duplessis b6f28e46f1 more tournament join optimization 2021-09-21 21:29:20 +02:00
Thibault Duplessis 95fff08b50 optimize tournament endpoints 2021-09-21 21:21:01 +02:00
kraktus 2f9893d3b8 scalafmt 2021-09-21 17:37:00 +02:00
kraktus 057c6fd24f Tournament: Translate Perf 2021-09-21 17:35:23 +02:00
Thibault Duplessis 5ee55e1327 add ?withCurrentGames=1 flag to /api/stream/games-by-users endpoint 2021-09-21 10:03:10 +02:00
Thibault Duplessis 123980730e Revert "tweak user profile code"
This reverts commit 6fc82e775a.
2021-09-20 19:12:27 +02:00
Thibault Duplessis 31ba5d3a08 type safety: use Status rather than Int - for #9850
also filters out exotic status numbers
2021-09-20 18:58:00 +02:00
Thibault Duplessis ab0c01e2a1 Merge branch 'api-filter-user-tournaments-by-status' of git://github.com/nnickoloff1234/lila into nnickoloff1234-api-filter-user-tournaments-by-status
* 'api-filter-user-tournaments-by-status' of git://github.com/nnickoloff1234/lila:
  Update TournamentRepo.scala
  add status filter parameter to users created tournaments api
2021-09-20 18:38:32 +02:00
Thibault Duplessis ced5e57c93 don't always publish user.online to discourage API misuse
Use this instead: https://lichess.org/api#operation/apiUsersStatus
2021-09-20 17:54:43 +02:00
nnickoloff1234 d564bd9933
Update TournamentRepo.scala 2021-09-20 18:46:40 +03:00