Skip to content

fix(monero-dashboard): repair the true-luck window label - #4386

Merged
Tanguille merged 1 commit into
mainfrom
fix/monero-dashboard-luck-window
Aug 6, 2026
Merged

fix(monero-dashboard): repair the true-luck window label#4386
Tanguille merged 1 commit into
mainfrom
fix/monero-dashboard-luck-window

Conversation

@Tanguille

Copy link
Copy Markdown
Owner

One-line fix on main. displayDays is not defined.

dashboard.js:900

const cappedWindowDays = Math.min(timeWindowDays, MAX_WINDOW_DAYS);
const displayHours = cappedWindowDays * 24;
...
  : `${displayDays.toFixed(1)}d window`;   // <- undefined

#4378's simplify pass renamed displayDays to cappedWindowDays and updated two of the three references. Main before that pass was correct:

const displayDays = Math.min(timeWindowDays, MAX_WINDOW_DAYS);
const displayHours = displayDays * 24;

Why it matters

That branch is the else of displayHours < 24, so it fires whenever the mining window is at least a day, which is the normal case. The ReferenceError is caught by the enclosing try, which calls reset() and blanks the whole card:

} catch (error) {
  console.error("Error updating Estimated True Luck card:", error);
  reset();
}

So "Estimated True Luck" shows for both the factor and the window, with nothing visible except a console error. The luck factor is computed and set correctly one line earlier, then thrown away.

Verification

node --check passes. Scope-checked every identifier in updateWindowLuck against its params, locals, and module-level declarations after stripping comments and string literals: displayDays was the only undefined one, and no other reference to it or to the other locals the rename removed survives anywhere in the file.

The pass that renamed displayDays to cappedWindowDays missed the third
template literal. That branch fires whenever the window is at least 24h,
which is the normal case, so it threw a ReferenceError that the enclosing
catch turned into reset() - blanking both the luck factor and the window
on the Estimated True Luck card rather than surfacing anything.
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Tanguille, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 26 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b697e96f-2e96-4ec9-8b92-8ae4ab860fe1

📥 Commits

Reviewing files that changed from the base of the PR and between e27d6da and d69e644.

📒 Files selected for processing (1)
  • kubernetes/apps/web3/monero/dashboard/resources/dashboard.js

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@deepsource-io

deepsource-io Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

DeepSource Code Review

We reviewed changes in e27d6da...d69e644 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Aug 6, 2026 10:18p.m. Review ↗
Shell Aug 6, 2026 10:18p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@Tanguille
Tanguille merged commit 8915d42 into main Aug 6, 2026
7 checks passed
@Tanguille
Tanguille deleted the fix/monero-dashboard-luck-window branch August 6, 2026 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant