Skip to content

Conversation

@neooriginal
Copy link
Collaborator

As we now allow the import of limitless data, i thought it would be a good idea to also allow import / export OMI data.
Exporting is self explanatory why this would be good - especially as OMI is trying to be as open as possible. Importing would be good too as some people might switch accounts or want to share data.

img


Technical Docs:

This pull request adds a complete OMI data import/export feature to both the backend and frontend, allowing users to export their OMI data as a ZIP file, import OMI data from a ZIP file, and delete imported OMI data. The implementation includes new API endpoints, backend logic for handling ZIP files, and corresponding UI elements and workflows in the Flutter app.

Backend API and Data Handling

  • Added backend support for OMI data import/export, including three new endpoints: exporting user data as a ZIP, importing from a ZIP, and deleting imported data. These endpoints handle ZIP file creation, background import processing, and data deletion. (backend/routers/imports.py, models/import_job.py) [1] [2]
  • Introduced the omi import source type to the import job model to distinguish OMI-related imports. (models/import_job.py)

Frontend UI and Workflow

  • Implemented new Flutter UI components for OMI import/export: added an OMI card to the import history page with options to export, import, and delete OMI data, including progress indicators and error handling. (app/lib/pages/settings/import_history_page.dart) [1] [2]
  • Added frontend logic for handling OMI data export (download ZIP and share), import (pick ZIP file and upload), and deletion (confirmation dialog and progress feedback). (app/lib/pages/settings/import_history_page.dart, app/lib/backend/http/api/imports.dart) [1] [2]
  • Integrated the share_plus package to enable sharing of exported ZIP files directly from the app. (app/lib/pages/settings/import_history_page.dart)

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a valuable feature for importing and exporting OMI data. The implementation is comprehensive, covering both backend and frontend changes. However, I've identified several critical and high-severity issues that need to be addressed before merging. These include a path traversal vulnerability, a potential denial-of-service vulnerability in the zip file processing, incomplete data deletion logic, and a couple of bugs in the frontend implementation. My detailed comments provide specific suggestions for fixing these issues.

@neooriginal neooriginal marked this pull request as draft December 9, 2025 16:24
neooriginal and others added 4 commits December 9, 2025 17:25
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@neooriginal
Copy link
Collaborator Author

@gemini-code-assist review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive feature for exporting and importing OMI data, enhancing user control over their information. The changes include new API endpoints for handling ZIP file exports and imports, along with corresponding UI updates in the Flutter application. The backend efficiently processes data in batches and manages temporary files, while the frontend provides clear progress indicators and error feedback. Overall, the implementation is robust and well-structured, significantly improving data portability for users. The review comments highlight valid points regarding type safety in Dart and consistency in Python enum usage, contributing to the overall code quality.

neooriginal and others added 4 commits December 9, 2025 17:38
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
@neooriginal
Copy link
Collaborator Author

@gemini-code-assist review

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive OMI data import/export feature, covering both frontend and backend aspects. The implementation includes new API endpoints for exporting user data as a ZIP, importing from a ZIP, and deleting imported data. The frontend integrates these functionalities with new UI components and workflows, providing a smooth user experience. The backend logic correctly handles ZIP file processing, background import tasks, and efficient batch operations for database interactions. Error handling and progress reporting are also well-considered. No high or critical severity issues were found in the reviewed code changes.

@neooriginal neooriginal marked this pull request as ready for review December 9, 2025 16:42
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.

1 participant