Remove interaction saver and simplify ProbeSaver#822
Conversation
(since we don't cache there anyways)
This is because Psych got stricter about which classes can be deserialized for security reasons. Maybe related: https://discuss.rubyonrails.org/t/cve-2022-32224-possible-rce-escalation-bug-with-serialized-columns-in-active-record/81017
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 the Bootstrap&Vite guide here: https://getbootstrap.com/docs/5.3/getting-started/vite/#configure-vite
According to this post: https://dev.to/chmich/setup-jquery-on-vite-598k
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?
This reverts commit c8567a5.
…points` Later, those shouldn't be global stylesheets anymore as this is heavily polluting.
Didn't find out where it was needed...
(The vite_image_tag is not applicable here)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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_idtoattempt_tokenfor 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
…revent race conditions" This reverts commit d6b465e.
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