You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(AniTilky): handle undefined lang setting - #11469
presence.getSetting<string>('lang') can resolve to undefined (it does not reject), so the .catch(() => 'en') fallback in getSettings() never applied. getStrings() then threw synchronously on lang.startsWith('tr'):
[PreMiD] Error in UpdateData handler: TypeError: Cannot read properties of undefined (reading 'startsWith')
Because strings was never assigned, the !strings check retried on every UpdateData tick and threw again. As a result the console filled with errors and no activity was ever set.
Changes:
presence.ts: default the lang setting to 'en' when it resolves to a falsy value
functions/strings.ts: getStrings() accepts an optional lang and no longer throws on a missing value
getSetting('lang') can resolve to undefined instead of rejecting, so the
.catch fallback never ran and getStrings threw on lang.startsWith. Because
strings was never assigned, every UpdateData tick retried and threw again,
so no activity was ever set.
Default the setting to 'en' and make getStrings tolerate a missing value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review was skipped as selected files did not have any reviewable changes.
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: d24e305a-9c51-468e-b7ae-c040d6aff41f
Commits
Reviewing files that changed from the base of the PR and between cbabf97 and 18a3b72.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
AniTilky now defaults empty or missing language values to English. Turkish language matching is case-insensitive. The metadata version changes from 2.0.1 to 2.0.2.
Changes: AniTilky language handling
Layer / File(s)
Summary
Language defaults and string selection websites/A/AniTilky/presence.ts, websites/A/AniTilky/functions/strings.ts, websites/A/AniTilky/metadata.json
getSettings defaults empty and rejected language settings to en. getStrings accepts an omitted language, matches the tr prefix without case sensitivity, and selects English for other values. The metadata version changes to 2.0.2.
This change makes AniTilky fall back to English when the language setting is empty or missing, which prevents repeated errors and a missing activity. It is localized and easy to revert, so merge risk is minimal.
Security architecture risk: Minimal · up to ed4f1
The change restores activity updates when the language setting is missing and preserves existing privacy controls. No introduced or worsened architecture-level security risk was identified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title 'fix(AniTilky): handle undefined lang setting' matches the main change. The PR defaults a missing or empty lang setting to 'en', makes the lang parameter of getStrings optional, and bumps th…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check
Explanation
The title 'fix(AniTilky): handle undefined lang setting' matches the main change. The PR defaults a missing or empty lang setting to 'en', makes the lang parameter of getStrings optional, and bumps the AniTilky metadata version. The title names the bug fix and the affected component, so a teammate scanning history can identify the primary change.
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 63a6217f-5aea-42cf-b396-12cf43df457f
Commits
Reviewing files that changed from the base of the PR and between c8b3fac and ed4f1d3.
Files selected for processing: 3
websites/A/AniTilky/functions/strings.ts
websites/A/AniTilky/metadata.json
websites/A/AniTilky/presence.ts
Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
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
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.
Description
presence.getSetting<string>('lang')can resolve toundefined(it does not reject), so the.catch(() => 'en')fallback ingetSettings()never applied.getStrings()then threw synchronously onlang.startsWith('tr'):Because
stringswas never assigned, the!stringscheck retried on everyUpdateDatatick and threw again. As a result the console filled with errors and no activity was ever set.Changes:
presence.ts: default thelangsetting to'en'when it resolves to a falsy valuefunctions/strings.ts:getStrings()accepts an optionallangand no longer throws on a missing valuemetadata.json: bump version2.0.1→2.0.2Acknowledgements
npm run lintScreenshots
Proof showing the creation/modification is working as expected
eslint websites/A/AniTilkypasses andpmd build AniTilkytype-checks and compiles successfully.Summary by CodeRabbit