-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into report-reason-no-store
- Loading branch information
Showing
151 changed files
with
1,175 additions
and
831 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,18 @@ | ||
#!/bin/sh | ||
|
||
pnpm lint-staged | ||
# Short circuit lint-staged to avoid waiting on node when not needed. Even | ||
# when no files match, and we execute lint-stage directly, it still delays | ||
# the commit by .15s or so, which is annoying. | ||
if \git --no-pager diff-index -z --name-only --no-renames --cached HEAD | \ | ||
\grep -qzE '\.(json|scss|ts)$'; then | ||
# NOTE! grep must be kept in sync with lint-staged in package.json! | ||
|
||
LINT_STAGED="$(dirname -- "$0")/../../node_modules/.bin/lint-staged" | ||
|
||
# pnpm or npx adds .25s overhead. exec further reduces overhead. | ||
if [ -x "$LINT_STAGED" ]; then | ||
exec "$LINT_STAGED" | ||
else | ||
exec pnpm lint-staged | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package lila.api | ||
|
||
import play.api.libs.json.* | ||
|
||
import lila.db.JSON | ||
import lila.core.config.NetConfig | ||
|
||
final class SocketTestResult(resultsDb: lila.db.AsyncCollFailingSilently)(using Executor): | ||
def put(results: JsObject) = resultsDb: coll => | ||
coll.insert.one(JSON.bdoc(results)).void | ||
|
||
object SocketTest: | ||
|
||
def isUserInTestBucket(net: NetConfig)(using ctx: Context) = | ||
net.socketTest && ctx.pref.usingAltSocket.isEmpty && ctx.userId.exists(_.value.toList.sum % 128 == 0) | ||
|
||
def socketEndpoints(net: NetConfig)(using ctx: Context): List[String] = | ||
ctx.pref.usingAltSocket.match | ||
case Some(true) => net.socketAlts | ||
case Some(false) => net.socketDomains | ||
case _ if isUserInTestBucket(net) => net.socketDomains.head :: net.socketAlts.headOption.toList | ||
case _ => net.socketDomains |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.