Skip to content
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

load_facet in browse lists should not proceed if the CSV file is empty #4724

Open
1 of 5 tasks
sandbergja opened this issue Jan 26, 2025 · 0 comments
Open
1 of 5 tasks
Labels
bug 🐛 The application does not work as expected because of a defect maintenance Ticket related to maintenance that needs to be done

Comments

@sandbergja
Copy link
Member

What maintenance needs to be done?

The load_facet method in the BrowseLists module should check to make sure that the CSV is a reasonable size before it does its work.

Level of urgency

  • High
  • Moderate
  • Low

Why is this maintenance needed?

This way, if the previous task has failed and produces an empty CSV, we do not end up with a completely empty browse list.

Currently, we can experience the following situation:

  • there is an error in, say, the browse:name_titles rake task
  • the error causes the /tmp/alma_orangelight_name_titles.csv file to be totally empty
  • load_facet doesn't check the file size, and happily TRUNCATEs the entire table
  • Since the csv file is empty, load_facet cannot add any data back into the table
  • The production database has an empty browse list :-(

Acceptance criteria

  • load_facet does not TRUNCATE the current data if the relevant csv file is empty
  • load_facet does not TRUNCATE the current data if the relevant csv file is much smaller than it should be
@sandbergja sandbergja added the maintenance Ticket related to maintenance that needs to be done label Jan 26, 2025
@kevinreiss kevinreiss added the bug 🐛 The application does not work as expected because of a defect label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 The application does not work as expected because of a defect maintenance Ticket related to maintenance that needs to be done
Projects
None yet
Development

No branches or pull requests

2 participants