Repository navigation
Fix CSS performance issues from #857 while preserving functionality - #928
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…928) ## Description: Replaces the `all` selector with a specific class to reduce CSS computation. Maintains functionality of hiding the news button. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: `demonessica`
Resolves openfrontio/ai-ops#98 (no OpenFrontIO issue; filed by the ops pipeline) ## Description: **What was wrong.** infra #928 bounds `POST /join_verify` at 4 s. When siteverify or the name check fails or runs past that budget, it answers `200 {status:"error", reason, username?, clanTag?}`, with the screened identity attached when the name check finished. `JoinVerifyVerdictSchema` here accepted only `approved` and `rejected`. Once #928 is deployed, every one of those answers would be logged as `api-worker returned malformed response` at error level, and the API's name verdict would be thrown away. Fail-open joins were already running at about 10× their usual rate (see the ai-ops issue), so those lines would keep firing and the joins would fall back to the coarser local censor. **What changed.** - `src/server/JoinVerify.ts`: the schema now accepts `status: "error"`. `JoinVerifyResponse`'s error variant gains two fields: - `degraded`: true when the API itself reported the failure, false for abort/network, non-2xx or a malformed body. - `identity`: the API's screened `{username, clanTag}`, present only when the name check finished; an absent `clanTag` becomes null. - `src/server/Worker.ts`: on `error`, the join uses the API's identity when it is present and otherwise keeps the locally screened name, as before. The API-reported case is logged as `join_verify degraded` at **warn**. An unreachable or broken API is still `join_verify error` at **error**. - This works with the API currently in production, which never sends `status: "error"`. Note for dashboards and alerts: budgeted degradations move from the `join_verify error` line to `join_verify degraded`. Nothing in infra's `src/ops` queries this line. Grafana queries such as the issue's `|= "join_verify error"` will only count real outages from now on. **Alternatives considered.** I kept one log message and only lowered its level. Two distinct messages make the outage case easy to count on its own, and the existing query keeps its meaning. I also considered keeping the local censor even when the API sends an identity. The API's name check is the authoritative screen, and the same identity is applied on approval, so this PR uses it. **What I ran.** - I ran `npx vitest tests/server/JoinVerify.test.ts --run` with the new tests and without the fix: 7 failed (3 new degraded-verdict tests, plus 4 existing failure-mode tests that now also assert `degraded: false`). With the fix all 23 pass. - `npx vitest tests/server --run`: 912 passed. - `npm run typecheck`, `npm run lint` and prettier on the touched files all pass. ## Please complete the following: - [x] I have added screenshots for all UI updates (no UI changes) - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file (no user-visible text) - [x] I have added relevant tests to the test directory Fixes openfrontio/ai-ops#98 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01Pn2xZjE8oUY44wToJE4NFe --- _Generated by [Claude Code](https://claude.ai/code/session_01Pn2xZjE8oUY44wToJE4NFe)_ Co-authored-by: Claude <noreply@anthropic.com>
Description:
Replaces the
allselector with a specific class to reduce CSS computation. Maintains functionality of hiding the news button.Please complete the following:
Please put your Discord username so you can be contacted if a bug or regression is found:
demonessica