Skip to content

feat(tracker): enforce 16-hour daily study limit and drop excessive records - #423

Merged
trtajim merged 2 commits into
mainfrom
feat/tracker-16h-daily-cap
Oct 16, 2026
Merged

trtajim merged 2 commits into
mainfrom
feat/tracker-16h-daily-cap

Conversation

@trtajim

@trtajim trtajim commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Description

This PR addresses leaderboard and study tracker abuse by implementing a realistic 16-hour daily study cap and cleaning up invalid excessive records.

Changes

  • Migration: Added and executed a migration to delete historical daily_study_logs entries exceeding 16 hours (total_seconds > 57600).
  • Backend: Defined DailyStudyLog::MAX_DAILY_SECONDS = 57600 (16 hours) and updated StudyTrackerController validation and daily cap calculations.
  • Frontend: Updated StopwatchWidget.vue remaining time checks and manual input warnings to reflect the 16-hour limit.
  • Leaderboard: Updated the fair-play and daily cap notice in the Leaderboard rules modal to specify the 16-hour limit.
  • Testing: Added test cases in StudyTrackerTest ensuring requests exceeding 16 hours are rejected and cumulative daily logs cannot exceed 16 hours.

Summary by CodeRabbit

  • Updates
    • Daily study time is now limited to 16 hours. Stopwatch sessions, quick logs, and manual entries are capped at the remaining daily allowance.
    • The leaderboard FAQ now reflects the 16-hour daily limit.
    • Existing daily logs exceeding 16 hours are removed.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Repository: hscstack/platform/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 84e07383-0549-46a8-9dc1-01d103f09605
📥 Commits

Reviewing files that changed from the base of the PR and between faca3a2 and 3d8d8ba.

📒 Files selected for processing: 6
  • app/Http/Controllers/StudyTrackerController.php
  • app/Models/DailyStudyLog.php
  • database/migrations/2026_10_16_124500_drop_excessive_daily_study_logs.php
  • resources/js/components/tracker/StopwatchWidget.vue
  • resources/js/pages/Leaderboard/Index.vue
  • tests/Feature/StudyTrackerTest.php
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@trtajim
trtajim merged commit 0927ba7 into main Oct 16, 2026
5 checks passed
@trtajim
trtajim deleted the feat/tracker-16h-daily-cap branch October 16, 2026 06:52
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