-
Notifications
You must be signed in to change notification settings - Fork 4
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
Repo improvement #66
Repo improvement #66
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
name: Publish to App Store Connect | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
on: push | ||
|
||
jobs: | ||
ios_deploy: | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -90,8 +90,10 @@ class NetworkImagePreviewStateNotifier | |||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
@override | ||||||||||||||||||||||||||
void dispose() { | ||||||||||||||||||||||||||
tempFile?.deleteSync(); | ||||||||||||||||||||||||||
void dispose() async { | ||||||||||||||||||||||||||
if (tempFile != null && await tempFile!.exists()) { | ||||||||||||||||||||||||||
await tempFile!.delete(); | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
Comment on lines
+93
to
+96
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider calling super.dispose() first While the async file cleanup is a good improvement, calling Consider this refactor: -void dispose() async {
+@override
+Future<void> dispose() async {
+ super.dispose();
if (tempFile != null && await tempFile!.exists()) {
await tempFile!.delete();
}
cancelToken?.cancel();
- super.dispose();
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||
cancelToken?.cancel(); | ||||||||||||||||||||||||||
super.dispose(); | ||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||
|
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -825,6 +825,8 @@ class MediaProcessRepo extends ChangeNotifier { | |||||||||||||||||||||||||||
return; | ||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
rethrow; | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Maintain consistent error handling across providers The error handling differs between Google Drive and Dropbox downloads. While Google Drive rethrows the error, Dropbox silently handles it. This inconsistency could lead to different behavior depending on the provider. Consider applying the same error handling pattern to both providers. Either:
The choice depends on whether the calling code needs to handle these errors. Fix error handling flow The Consider this fix: } catch (error) {
if (error is DioException && error.type == DioExceptionType.cancel) {
showNotification('Download from Google Drive cancelled');
return;
}
- rethrow;
-
showNotification('Failed to download from Google Drive');
await updateDownloadProcessStatus(
status: MediaQueueProcessStatus.failed,
id: process.id,
);
+ rethrow;
} 📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||
showNotification('Failed to download from Google Drive'); | ||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||
await updateDownloadProcessStatus( | ||||||||||||||||||||||||||||
|
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.
Critical: Restrict deployment triggers to production-ready branches
The current trigger configuration will run the deployment workflow on any push to any branch, which could lead to unintended deployments to App Store Connect. This is particularly risky for a production deployment workflow.
Consider restricting the workflow to run only on production-ready branches and tags:
📝 Committable suggestion