Fix ATM passive income and improve iteration safety - #132
Conversation
Modified MainViewModel.kt to check if an ATM stall was enabled during the wave before awarding passive income. The logic now snapshots the set of enabled stalls before decrementing their 'disabledWaves' counters. This ensures that stalls disabled by upgrades do not pay out for that wave, while still allowing stalls re-enabled in the same tick (like Bak Kut Teh) to provide their bonuses to the payout amount. Additionally, added toList() to the iteration over updatedHexes during wave completion to ensure safety against concurrent modifications and added a comprehensive regression test in AtmDisabledTest.kt. Fixes: FIX-003 Co-authored-by: candour <4670475+candour@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe PR fixes an ATM passive income bug where disabled stalls were incorrectly contributing income. Wave completion now snapshots which stalls were enabled before decrementing their ChangesATM Income Eligibility Fix
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ff9b5a8d-ce7d-4ca4-bcd5-21523171687c
📒 Files selected for processing (3)
app/src/main/java/com/messark/hawker/MainViewModel.ktapp/src/test/java/com/messark/hawker/AtmDisabledTest.ktfixes.md
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
|
Add Dispatchers.resetMain() teardown to avoid test dispatcher leakage. Dispatchers.setMain(testDispatcher) is set in the @before setup but never reset, which can pollute other tests in the same JVM run. |
Thank you for the feedback. I've added |
Added @after tearDown methods with Dispatchers.resetMain() to AtmDisabledTest and BakKutTehSameTickTest to avoid test dispatcher leakage across test runs. Co-authored-by: candour <4670475+candour@users.noreply.github.com>
Build Successful! 🚀Note: This link will be removed when the PR is closed. |
|
@coderabbitai resolve |
✅ Actions performedComments resolved and changes approved. |
Fixes a logic bug where ATM stalls would provide passive income even if they were disabled (e.g., due to an upgrade). The fix ensures income is only collected if the stall was enabled throughout the wave. It also improves iteration safety during the wave completion phase.
PR created automatically by Jules for task 15518195651156498222 started by @candour
Summary by CodeRabbit
Release Notes