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

Repo improvement #66

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/ios_deploy.yml
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
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

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:

-on: push
+on:
+  push:
+    branches:
+      - main
+      - release/*
+    tags:
+      - 'v*'
+  workflow_dispatch:  # Allow manual triggers for flexibility
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
on: push
on:
push:
branches:
- main
- release/*
tags:
- 'v*'
workflow_dispatch: # Allow manual triggers for flexibility


jobs:
ios_deploy:
Expand Down
30 changes: 0 additions & 30 deletions .idea/libraries/Dart_Packages.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/lib/ui/flow/home/home_screen_view_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import 'package:data/services/auth_service.dart';
import 'package:data/services/google_drive_service.dart';
import 'package:data/services/local_media_service.dart';
import 'package:data/storage/app_preferences.dart';
import 'package:firebase_crashlytics/firebase_crashlytics.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:google_sign_in/google_sign_in.dart';
Expand Down Expand Up @@ -516,6 +517,7 @@ class HomeViewStateNotifier extends StateNotifier<HomeViewState>
provider: MediaProvider.googleDrive,
);
} catch (e, s) {
await FirebaseCrashlytics.instance.recordError(e, s);
state = state.copyWith(actionError: e);
_logger.e(
"HomeViewStateNotifier: unable to download from google drive",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Consider calling super.dispose() first

While the async file cleanup is a good improvement, calling super.dispose() after async operations can be problematic as the parent class might be disposed while operations are still pending.

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

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
void dispose() async {
if (tempFile != null && await tempFile!.exists()) {
await tempFile!.delete();
}
@override
Future<void> dispose() async {
super.dispose();
if (tempFile != null && await tempFile!.exists()) {
await tempFile!.delete();
}
cancelToken?.cancel();
}

cancelToken?.cancel();
super.dispose();
}
Expand Down
3 changes: 3 additions & 0 deletions data/.flutter-plugins
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# This is a generated file; do not edit or check into version control.
firebase_core=/Users/pratikcanopas/.pub-cache/hosted/pub.dev/firebase_core-3.8.1/
firebase_core_web=/Users/pratikcanopas/.pub-cache/hosted/pub.dev/firebase_core_web-2.18.2/
firebase_crashlytics=/Users/pratikcanopas/.pub-cache/hosted/pub.dev/firebase_crashlytics-4.2.0/
flutter_local_notifications=/Users/pratikcanopas/.pub-cache/hosted/pub.dev/flutter_local_notifications-18.0.1/
flutter_local_notifications_linux=/Users/pratikcanopas/.pub-cache/hosted/pub.dev/flutter_local_notifications_linux-5.0.0/
google_sign_in=/Users/pratikcanopas/.pub-cache/hosted/pub.dev/google_sign_in-6.2.2/
Expand Down
Loading
Loading