Repository navigation
Don't call canSubmit() multiple times per category, and also update every single package in the project - #637
Open
mini-bomba wants to merge 7 commits into
Open
mini-bomba wants to merge 7 commits into
mini-bomba wants to merge 7 commits into
Conversation
mini-bomba
force-pushed
the
perms-opt
branch
7 times, most recently
from
September 15, 2026 15:17
a180a86 to
baaab29
Compare
mini-bomba
force-pushed
the
perms-opt
branch
from
September 15, 2026 18:19
af8d336 to
25aa5a5
Compare
mini-bomba
marked this pull request as ready for review
September 15, 2026 18:21
mini-bomba
force-pushed
the
perms-opt
branch
from
September 15, 2026 19:44
c6ce60c to
e7ddf2d
Compare
mini-bomba
force-pushed
the
perms-opt
branch
from
September 17, 2026 08:20
e7ddf2d to
59c1e19
Compare
mini-bomba
force-pushed
the
perms-opt
branch
from
September 17, 2026 08:22
59c1e19 to
3304c55
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
started out as an effort to slightly optimize the permission checks - currently if you submit 100 chapters in one batch, the server calls
canSubmit()100 times, which makes 100 uncached vip queriesended up being a giant tangent involving updating literally every single dependency this project has, including typescript
things done:
.jssuffixes to be added everywhere; i instead converted everything to fragment imports#*defaults to the./srcdirectory, with an implicit.jssuffix#types/*is a special case that adds a.model.jssuffix instead#test/*instead looks in the./testdirectorytest/test.ts(script that would run mocha directly) withtest/setup.ts(script that exports global mocha hooks) and made mocha import it before running tests (along with tsx)ts-mock-importswith manual mockingts-mock-importsYouTubeAPI.listVideos()is a static method of a class, so i just overwrote the method directlyrateLimitMiddleware()is an exported function, so i implemented mocking support for itsetMockRateLimitMiddleware()is a new function that can be called with a replacement function forrateLimitMiddleware, orundefinedto reset the function to the default implrateLimitMiddleware()checks a variable set bysetMockRateLimitMiddleware()and if it's not undefined, it passes all the arguments to it and returns the resultreq.bodynow either use optional chaining or check whether the body exists at the start of processingreq.bodyis nullablereq.parambecause it appears to be readonly nowcanSubmitfor the same category within a single request are cached usingMap.getOrInsertComputedA server-side error was thrown while handling this request