-
Notifications
You must be signed in to change notification settings - Fork 6
Enforce session activities #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Let's not edit the element when you click the start button, but instead just do a generic alert telling the user to start the session. It should work as expected when the session is started (timer starts if the session is active). Later, we might change this into a more intuitive prompt with disabled buttons if the session is not active, but keep it simple right now. |
I have removed all the test-related code and the fixes I made to resolve the build failure that was caused by the tests.
|
@tbaugher-mie @trip-flip Did the code changes, can you please review it now? |
tbaugher-mie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Enforce Session Requirement for Activities
What’s Implemented
Frontend:
When a user clicks the Start button for an activity and the session is not active, a red error message (“Please start the session first.”) is shown above the Start button.
Activities cannot be started unless the session is active.
When the user clicks “Stop Session,” all running activities for that session/team are stopped in the UI.
Backend:
The server method for starting an activity now checks that a session is active before allowing the activity to start.
The server method for stopping a session ensures all running activities for the session/team are stopped, even if the frontend fails to do so.
Why
Prevents users from starting activities without an active session.
Ensures all activities are stopped when the session ends.
Maintains data consistency and improves user experience.
Adds server-side safety to prevent bypassing frontend checks.
Acceptance Criteria
Users cannot start any activity unless the main session is active.
Attempting to start an activity before the session is started displays a clear, contextual error message above the Start button.
When the main session is stopped, all running activities for that session are automatically stopped.
The UI updates immediately to show that no activity is running after the session is stopped.
No activity can remain running without an active session (data consistency is enforced).
Server-side checks prevent starting activities without an active session.
Demo video:
https://youtube.com/shorts/JBbCbII91l0?si=ESPuov_d-Fn6vEds