Skip to content

Conversation

@KidScripty
Copy link

@KidScripty KidScripty commented Jan 4, 2026

THIS IS CURRENTLY A DRAFT PULL REQUEST - Not yet completed

Type of change(s)

  • Bug fix
  • Feature / enhancement
  • Infrastructure / tooling (CI, build, deps, tests)
  • Documentation

What changed and why

Fix for the "tomorrow never comes" bug where alarms set for tomorrow would incorrectly be rescheduled for the next day when the app was reopened (after device restart) when the alarm time had passed.

Phase 1: Testing infrastructure & bug reproduction - Completed

  • Added unit tests for AlarmController reschedule logic
  • Refactored AlarmController.rescheduleEnabledAlarms() to extract testable shouldRescheduleAlarm() function
  • Made updateNonRecurringAlarmDay() accept optional time parameter for testing
  • Created failing test that reproduces the bug using actual production code

Phase 2: Bug fix - TODO

  • Updated shouldRescheduleAlarm() to properly handle stale TOMORROW_BIT values from database
  • Alarm that was set for "tomorrow" is now correctly skipped when reopening app on that day after the time has passed

Tests performed

  • Ran unit tests: ./gradlew testFossDebugUnitTest
  • Verified test fails before fix (demonstrating bug exists)
  • Verified test passes after fix (demonstrating bug is resolved)

Before & after preview

N/A - internal logic fix with no UI changes

Closes the following issue(s)

Checklist

  • I read the contribution guidelines.
  • I manually tested my changes on device/emulator (if applicable).
  • I updated the "Unreleased" section in CHANGELOG.md (if applicable).
  • I have self-reviewed my pull request (no typos, formatting errors, etc.).
  • All checks are passing.

AshBash added 2 commits January 4, 2026 23:19
…yOrg#293

Refactored AlarmController to move logic that causes bug to separate testable function with optional parameter for passing in currentDayMinutes

Refactored updateNonRecurringAlarmDay in Constants.kt with overloaded function, allowing testability with optional parameter currentDayMinutes

Added unit test class AlarmControllerTest.kt under app/src/test folder

Added readme explaining how to run tests
@KidScripty
Copy link
Author

KidScripty commented Jan 4, 2026

@naveensingh In this phase I have added unit tests to reproduce the issue which causes the build to fail intentionally.

More tests could be added to verify different scenarios as described in the original issue report.

If you are happy with this approach I can then push the fix which will then cause the build to succeed and pass the test.

Otherwise if you are not happy with adding unit tests to reproduce the issue then I will create a separate pull request with just the fix.

Copy link
Member

@naveensingh naveensingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but there are three problems:

  • The code isn't even testing the right thing. Making that test pass will be worse.
  • Obviously AI-generated (see guidelines).
  • I'm already working on this.

Continued use of AI tools to generate proposals, arguments and pull requests that don't meaningfully help the project or waste time will result in moderation.

@naveensingh naveensingh closed this Jan 5, 2026
@KidScripty
Copy link
Author

KidScripty commented Jan 5, 2026

1.) You are completely wrong and as usual with your comments, unjustified without giving anyone a chance to actually respond. This does help the project as it sets up unit tests (which you don't have) to test the functionality that results in the described bug in the issue. Also this is a DRAFT PR, which you could feedback on to improve.

2.) The code was not AI generated. I used copilot to help annotate comments only.

3.) How does extracting unit tests to reproduce the issue not result in a better way forward?

@KidScripty
Copy link
Author

KidScripty commented Jan 5, 2026

Literally all this code does currently is slightly refactors the existing area which results in the bug described in order to make the functions testable.

Adds unit tests (which can be improved to reproduce the exact state that results in the bug described). Yet you somehow have a problem with that because you assume everything AI generated when it isn't. I use AI to fill in forms, which I have seen you say yourself on other pull requests that you are "too lazy" to fill in.

This is reinforced by your comment on this pull request fixing a spacing issue in the stop watch lap times: #363

All you state is that changing the width isn't the correct fix and close it. No alternative explanation or anything, it's frankly just unprofessional. The other pull request is very simple, fixes the issue and you provide no justification.

@KidScripty
Copy link
Author

@naveensingh Is there anyone else in your organisation that can provide an objective second opinion on this or is it what you say goes?

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.

tomorrow never comes :-)

2 participants