-
Notifications
You must be signed in to change notification settings - Fork 26
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
feat(SNP-1314): Down by Maintenance #119
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #119 +/- ##
=======================================
Coverage 26.39% 26.39%
=======================================
Files 55 55
Lines 917 917
=======================================
Hits 242 242
Misses 675 675 ☔ View full report in Codecov by Sentry. |
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.
Can you rename the feature and the classes into "down_for_maintenance" to be grammatically correct?
lib/features/down_by_maintenance/domain/services/check_server_status_service.dart
Outdated
Show resolved
Hide resolved
lib/features/down_by_maintenance/domain/services/check_server_status_service.dart
Outdated
Show resolved
Hide resolved
lib/features/down_by_maintenance/data/services/fb_check_server_status_service.dart
Outdated
Show resolved
Hide resolved
lib/features/down_by_maintenance/data/services/mock_check_server_status_service.dart
Outdated
Show resolved
Hide resolved
lib/features/down_by_maintenance/presentation/down_by_maintenance_widget.dart
Outdated
Show resolved
Hide resolved
lib/features/down_by_maintenance/presentation/down_by_maintenance_widget.dart
Outdated
Show resolved
Hide resolved
lib/features/down_by_maintenance/presentation/down_by_maintenance_wm.dart
Outdated
Show resolved
Hide resolved
lib/features/down_by_maintenance/presentation/down_by_maintenance_wm.dart
Outdated
Show resolved
Hide resolved
lib/features/down_by_maintenance/presentation/down_by_maintenance_wm.dart
Outdated
Show resolved
Hide resolved
…-template into SNP-1314-down-by-maintenance
// TODO(init-project): In order to use Down For Maintenance feature you have to: | ||
// - create implementation of [ICheckServerStatusRepository] here | ||
// - call [ICheckServerStatusRepository.configure] and await for it | ||
// - call [ICheckServerStatusRepository.initImmediateCheck] | ||
// - add it to AppScope | ||
// - add DownForMaintenanceWidget in builder of MaterialApp in app.dart | ||
// Otherwise just delete this. | ||
|
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.
It is worth putting information about this also in the documentation in the repository itself, and provide link to the documentation here
void initImmediateCheck(); | ||
|
||
/// Method that configurate service. For example, you can configurate interval of requests. | ||
Future<void> configurate(); |
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.
configure() would be a more appropriate name
void initImmediateCheck(); | ||
|
||
/// Method that configurate service. For example, you can configurate interval of requests. | ||
Future<void> configurate(); |
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.
configure() would be a more appropriate name
Future<void> configurate() async { | ||
/// Here you can configurate your Firebase Remote Config interval of requests for example. | ||
/// For example: | ||
// | ||
// await remoteConfig.setConfigSettings(RemoteConfigSettings( | ||
// fetchTimeout: const Duration(minutes: 1), | ||
// minimumFetchInterval: const Duration(hours: 1), | ||
// )); | ||
// | ||
} | ||
|
||
@override | ||
Future<void> initImmediateCheck() async { | ||
/// Here you can make a request to your Firebase Remote Config to check if it is available. | ||
/// For example: | ||
// try { | ||
// await remoteConfig.fetchAndActivate(); | ||
// final isServerAvailable = remoteConfig.getBool('is_server_available'); | ||
// serverStatus.value = isServerAvailable ? ServerCheckResult.worksNormally : ServerCheckResult.notActive; | ||
// } on Exception catch (_) { | ||
// serverStatus.value = ServerCheckResult.errorOccurred; | ||
// } | ||
} |
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.
It seems that if the method is not implemented, you should add throw NotImplementedException()
to the template method body.
} | ||
|
||
/// Placeholder widget that shows when server is not available. | ||
/// Replace it with your own widget. |
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.
Sounds like a good place for // TODO(init-project)
Checklist
fix
,close
,resolve
etc. if necessary)New Features