Skip to content

Conversation

@rammakablecode
Copy link

References:

Approved PR: thoth-tech#83
Unmerged PR: thoth-tech#74

Description

This PR merges the changes from the approved PR #83 into the 10.0.x branch. It ensures the session tracking logic integrated includes schema fixes, environment blockers, and backend improvements previously approved in #83.

This PR directly references the approved work from #83 and makes it available in the target branch for further development and frontend integration.

Fixes identified issues that blocked development and limited the usefulness of the existing schema:

  • MySQL tablespace errors (errno: 194) that prevented successful migrations in Windows-hosted Docker environments.
  • CRLF line endings in shell scripts causing Dev Container startup failures.
  • Inefficient frontend computation of session_activity gaps.

Frontend impact
Persisting duration_minutes enables direct aggregation via the API and removes the need for complex time-delta calculations in the Angular frontend. This change is intended to support(thoth-tech/doubtfire-web#402). By providing this data via the API, we avoid complex time-delta calculations in the Angular frontend, allowing 402 to be refactored to connect directly to this backend logic since the frontend contributions are yet to connect to exisitng backend.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

How Has This Been Tested?

  • Test A: Migration Sequence
    Executed bundle exec rails db:migrate:redo VERSION=20250922103033.

    Verified:
    marking_sessions table is created successfully
    duration_minutes column exists
    No MySQL tablespace errors occur

  • Test B: Session Tracking Logic
    Ran bundle exec ruby -I test test/services/session_tracker_test.rb.
    Result: 2 runs, 13 assertions, 0 failures, 0 errors.
    Ran bundle exec rails test test/api/marking_sessions_api_test.rb
    6 runs, 67 assertions, 0 failures, 0 errors, 0 skips

image
Screenshot 2026-01-29 162100

Confirmed:
15-minute "sticky" session window works
duration_minutes is correctly updated upon activity.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes

martindolores and others added 4 commits January 26, 2026 19:14
@rammakablecode rammakablecode changed the base branch from development to 10.0.x February 1, 2026 05:36
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.

2 participants