-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat: export / import OMI data #3667
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
base: main
Are you sure you want to change the base?
feat: export / import OMI data #3667
Conversation
There was a problem hiding this 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.
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>
|
@gemini-code-assist review |
There was a problem hiding this 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.
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>
|
@gemini-code-assist review |
There was a problem hiding this 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.
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.
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
backend/routers/imports.py,models/import_job.py) [1] [2]omiimport source type to the import job model to distinguish OMI-related imports. (models/import_job.py)Frontend UI and Workflow
app/lib/pages/settings/import_history_page.dart) [1] [2]app/lib/pages/settings/import_history_page.dart,app/lib/backend/http/api/imports.dart) [1] [2]share_pluspackage to enable sharing of exported ZIP files directly from the app. (app/lib/pages/settings/import_history_page.dart)