Skip to content

Delete CSV files exported by previous versions of the app#451

Merged
tuancoltech merged 1 commit intomainfrom
300-delete-csv-files-exported-by-previous-versions-of-the-app
Feb 13, 2026
Merged

Delete CSV files exported by previous versions of the app#451
tuancoltech merged 1 commit intomainfrom
300-delete-csv-files-exported-by-previous-versions-of-the-app

Conversation

@tuancoltech
Copy link
Member

@tuancoltech tuancoltech commented Feb 11, 2026

Issue Number

Purpose

Only files generated by the current version of the app are uploaded the server: #286

Therefore, we no longer need to keep the files that were generated by previous versions of the app.

Delete all CSV files generated by previous versions of the app.

Regression Tests

  • I tested my changes on Android 16 (API 36)
  • I tested my changes on Android 15 (API 35)
  • I tested my changes on Android 14 (API 34)
  • I tested my changes on Android 13 (API 33)
  • I tested my changes on Android 12L (API 32)
  • I tested my changes on Android 12 (API 31)
  • I tested my changes on Android 11 (API 30)
  • I tested my changes on Android 10 (API 29)
  • I tested my changes on Android 9 (API 28)
  • I tested my changes on Android 8.1 (API 27)
  • I tested my changes on Android 8.0 (API 26)

UI Tests

  • I tested my changes on a 6-7" screen (▯ portrait orientation)
  • I tested my changes on a 6-7" screen (▭ landscape orientation)
  • I tested my changes on a 7-8" screen (▯ portrait orientation)
  • I tested my changes on a 7-8" screen (▭ landscape orientation)
  • I tested my changes on a 9-10" screen (▯ portrait orientation)
  • I tested my changes on a 9-10" screen (▭ landscape orientation)

Content Tests

  • I tested my changes with English content (eng.elimu.ai)
  • I tested my changes with Hindi content (hin.elimu.ai)
  • I tested my changes with Tagalog content (tgl.elimu.ai)
  • I tested my changes with Thai content (tha.elimu.ai)
  • I tested my changes with Vietnamese content (vie.elimu.ai)

Summary by CodeRabbit

  • Refactor

    • Improved code organization for event upload methods by consolidating file handling logic.
  • Chores

    • Added automatic cleanup of outdated event data files from previous app versions to optimize storage usage.

@tuancoltech tuancoltech requested a review from a team as a code owner February 11, 2026 04:34
@tuancoltech tuancoltech marked this pull request as draft February 11, 2026 04:34
@coderabbitai
Copy link

coderabbitai bot commented Feb 11, 2026

Walkthrough

The UploadEventsWorker class has been enhanced with internal housekeeping logic to manage CSV file lifecycle. Directory name constants now consolidate hardcoded strings, and a new cleanup function deletes CSV files from previous app versions while preserving those from the current version, using BuildConfig.VERSION_CODE for version matching.

Changes

Cohort / File(s) Summary
CSV File Version Management
app/src/main/java/ai/elimu/analytics/task/UploadEventsWorker.kt
Added private companion object with event type directory constants; introduced deleteCsvFilesFromPreviousVersions() method that scans lang- subdirectories, identifies CSV files from previous versions using BuildConfig.VERSION_CODE, and deletes them; refactored doWork() to invoke cleanup after upload operations.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes


As elimu.ai works toward its mission to build innovative learning software that empowers out-of-school children to teach themselves basic reading📖, writing✍🏽 and math🔢 within 6 months, maintaining clean and efficient app data management is essential. This change ensures that only the current version's analytics data is retained, reducing storage overhead and simplifying data management on user devices.

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description check ⚠️ Warning PR description covers Issue Number, Purpose, and Regression Tests with one Android version tested, but lacks Technical Details, Testing Instructions, Screenshots (UI/Content Tests), and UI Tests sections. Add Technical Details explaining the implementation approach, provide Testing Instructions for reviewers, and check appropriate boxes for UI Tests and Content Tests sections to complete the template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: deleting CSV files from previous app versions. It is concise and specific about the core modification.
Linked Issues check ✅ Passed The code changes directly address issue #300 by implementing deletion of CSV files from previous app versions using BuildConfig.VERSION_CODE, while preserving current version files.
Out of Scope Changes check ✅ Passed All changes are scoped to the UploadEventsWorker class and focus on the stated objective of deleting previous version CSV files. No unrelated modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 300-delete-csv-files-exported-by-previous-versions-of-the-app

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@tuancoltech tuancoltech changed the title WIP: Delete CSV files exported by previous versions of the app Delete CSV files exported by previous versions of the app Feb 12, 2026
@tuancoltech tuancoltech marked this pull request as ready for review February 12, 2026 07:22
@tuancoltech tuancoltech merged commit 6f5f770 into main Feb 13, 2026
9 checks passed
@tuancoltech tuancoltech deleted the 300-delete-csv-files-exported-by-previous-versions-of-the-app branch February 13, 2026 04:28
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.

Delete CSV files exported by previous versions of the app

1 participant