Skip to content

Remove interaction saver and simplify ProbeSaver#822

Merged
fosterfarrell9 merged 135 commits intonextfrom
features/remove-interactions
Aug 3, 2025
Merged

Remove interaction saver and simplify ProbeSaver#822
fosterfarrell9 merged 135 commits intonextfrom
features/remove-interactions

Conversation

@fosterfarrell9
Copy link
Collaborator

@fosterfarrell9 fosterfarrell9 commented Jul 20, 2025

As a preparation to tackle #677 we identified workers that are actually not needed and/or store unnecessary data, the InteractionSaver and the ProbeSaver being two of them. In this PR we remove/rewrite the corresponding code.

Note that this PR contains one irreversible migration. The migrations of the interactions database can be triggered by rails db:migrate:interactions.

First relevant commit on this branch: 3eb57bf

Splines added 30 commits June 11, 2025 11:44
(since we don't cache there anyways)
See this blog post by the creator of vite-rails:
https://maximomussini.com/posts/a-rubyist-guide-to-vite-js#getting-started

I've added the vite_rails gem, installed it, then ran:
bundle exec vite install

(Note that I removed the app/javascript folder beforehand, only locally,
as we don't need it.)

This is to get a basic setup.
Nothing is expected to work at this moment.
(since this file is referenced also from other layout files)
See https://github.com/rails/propshaft/blob/main/UPGRADING.md#3-migrate-from-sprockets-to-propshaft

Did not yet replace all asset_helpers (`image_url`, `font_url`) with standard `url`s.

And did also not include Propshaft since I want to see what Vite can do
for us first. Maybe we don't even need Propshaft after all?
…points`

Later, those shouldn't be global stylesheets anymore as this is heavily polluting.
Didn't find out where it was needed...
@Splines Splines changed the title Remove interaction saver worker and related code and simplify ProbeSaver Remove interaction saver and simplify ProbeSaver Aug 3, 2025
@Splines Splines temporarily deployed to testing-review August 3, 2025 09:48 — with GitHub Actions Inactive
Splines
Splines previously approved these changes Aug 3, 2025
Copy link
Member

@Splines Splines left a comment

Choose a reason for hiding this comment

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

Thanks, this looks good to me. I made some minor commits, please verify them before squash-merging into next.

As a side-note: since the interactions schema is getting smaller, we might want to consider integrating it into the usual schema in the future to only have one database in the end.

@Splines Splines requested a review from Copilot August 3, 2025 09:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the InteractionSaver worker and simplifies the ProbeSaver worker by eliminating study participant tracking and unnecessary data collection. The changes prepare the codebase for issue #677 by removing unused workers and reducing data storage overhead.

Key changes:

  • Complete removal of the InteractionSaver worker and related interaction tracking functionality
  • Simplification of ProbeSaver to only store essential quiz attempt data
  • Renaming of session_id to attempt_token for better semantic clarity

Reviewed Changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/workers/interaction_saver.rb Completely removed the InteractionSaver worker class
app/workers/probe_saver.rb Simplified to only accept essential parameters (quiz_id, question_id, correct, progress, attempt_token)
app/models/interaction.rb Removed the entire Interaction model and its CSV export functionality
app/models/probe.rb Removed CSV export functionality and date-based scoping
app/models/quiz_round.rb Updated to use attempt_token instead of session_id and removed study participant logic
app/controllers/interactions_controller.rb Removed the entire controller for interaction management
app/controllers/application_controller.rb Removed the store_interaction after_action callback
db/interactions_migrate/*.rb Added migrations to drop interactions table and clean up probe schema
spec/factories/*.rb Updated factories to use attempt_token instead of session_id
Comments suppressed due to low confidence (1)

app/models/quiz_round.rb:86

  • The magic number 13 should be extracted to a named constant to improve code readability and maintainability.
      @progress_old = @progress

@fosterfarrell9 fosterfarrell9 merged commit 21c9a35 into next Aug 3, 2025
5 checks passed
@fosterfarrell9 fosterfarrell9 deleted the features/remove-interactions branch August 3, 2025 19:54
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.

3 participants