Troubleshooting
Relevant source files
The following files were used as context for generating this wiki page:
The Troubleshooting guide provides technical insights into identifying and resolving issues within the Solo Leveling Penalty System. This system is a client-side web application that manages user progression, task generation, and automated penalty application based on daily cycles.
The primary scope of troubleshooting involves the localStorage data persistence, the KSA (Kingdom of Saudi Arabia) time zone synchronization, and the dynamic level/rank calculation logic. Since the system operates entirely in the browser, most issues stem from state inconsistencies in localStorage or date-parsing errors during the daily reset check.
Sources: index.html:1-5, Quest.html:105-110
Data Persistence and State Issues
The system relies on a single localStorage key to store the user's entire progress. If this data becomes corrupted or is manually edited, the application may fail to render tasks or calculate levels correctly.
Storage Structure
The system expects a JSON object with the following structure:
points: Integer representing total XP.lastUpdate: String (ISO format YYYY-MM-DD) for the last reset date.dailyTasks: Array of objects containing task names, categories, and completion status.lastPenalty: Integer representing the most recent points deduction.
Sources: index.html:117-119, Quest.html:117-119
The flowchart above illustrates the initialization logic where the system attempts to retrieve solo_penalty_v1 from local storage.
Sources: index.html:117-119, Quest.html:117-119
Daily Cycle and Reset Failures
The checkDailyCycle function is responsible for applying penalties for unfinished tasks and generating new tasks for the current day. Failures in this module usually result in tasks not refreshing or penalties being applied multiple times.
Time Zone Synchronization
The system strictly uses the Asia/Riyadh time zone for date comparisons. If the client's system clock is significantly inaccurate or if the browser does not support Intl.DateTimeFormat, the daily reset may trigger at incorrect intervals.
const ksaDate = new Intl.DateTimeFormat('en-CA', {
timeZone: 'Asia/Riyadh',
year: 'numeric',
month: '2-digit',
day: '2-digit'
}).format(new Date());
Sources: index.html:164-165, Quest.html:164-165
Penalty Logic Issues
If a user leaves tasks incomplete and returns the next day, the system calculates a penalty based on the pen attribute of the user's rank at the time of the check.
| Symptom | Potential Cause | Source Reference |
|---|---|---|
| Points dropped to 0 | Penalty exceeds current points or logic reset points | index.html:178 |
| Tasks didn't refresh | lastUpdate matches current ksaDate | index.html:184 |
| Penalty not shown | lastPenalty reset by toggleTask | index.html:194 |
Sources: index.html:164-188, Quest.html:164-188
Logic and Calculation Errors
Leveling and ranking are derived dynamically from the points value. Discrepancies between the Level and Rank are usually due to the tiered requirement logic in getRankConfig and calculateLevel.
Rank Configuration Table
The following configuration determines the difficulty (diff), reward, and penalty values.
| Rank | Points Threshold | Reward | Penalty | Requirement (XP per Level) |
|---|---|---|---|---|
| R | 3000+ | 6 | 8 | 50 |
| SS | 2000 | 6 | 8 | 40 |
| S | 1200 | 4 | 6 | 30 |
| A | 800 | 4 | 6 | 25 |
| B | 500 | 4 | 6 | 20 |
| C | 300 | 3 | 5 | 15 |
| D | 150 | 3 | 5 | 12 |
| E/F | <150 | 2 | 3 | 10 |
Sources: index.html:121-131, Quest.html:121-131
Level Progression Flow
The level calculation uses a while(true) loop that subtracts requirements until the remainder is less than the current level's threshold. An infinite loop could occur if currentReq were ever to return 0 or a negative number.
Sources: index.html:133-142, Quest.html:133-142
UI Rendering and Interaction Issues
The UI is built using template literals and direct DOM manipulation via document.getElementById.
- Tasks not appearing: Ensure
tasks-listcontainer exists in the HTML. Therender()function clears and repopulates this element every time a task is toggled. - Clock frozen: The
saudi-timedisplay is updated via asetIntervalevery 1000ms. If JavaScript execution is blocked or the tab is throttled, the clock may appear to lag. - Visual Glitches: The
xp-barwidth is updated using a CSS transition. IflvData.progressis calculated incorrectly (e.g., NaN), the bar may disappear.
Sources: index.html:144-162, Quest.html:144-162, index.html:198-207
Conclusion
Troubleshooting the Solo Leveling System primarily requires validating the state of localStorage and ensuring the date-based reset logic aligns with the Asia/Riyadh time zone. Most functional issues can be resolved by clearing the browser storage or correcting the system time. The architecture's reliance on dynamic rank configurations ensures that rewards and penalties scale automatically, provided the points data remains consistent.