Skip to content

Refactoring to remove late variables and cyclic dependencies #247

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

Merged
merged 31 commits into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
1497f9e
Cleaned up `config_handler.dart`
eliasyishak Mar 6, 2024
d42be71
Cleaned up `log_handler.dart`
eliasyishak Mar 6, 2024
f985614
Cleaned up `session.dart`
eliasyishak Mar 6, 2024
f86338b
Clean up `survey_handler.dart`
eliasyishak Mar 6, 2024
4b597f4
Confighandler no longer late variable
eliasyishak Mar 7, 2024
5e93021
Remove `Initializer` dependency from `ConfigHandler`
eliasyishak Mar 7, 2024
1640a33
Remove `late` variable for `_clientId`
eliasyishak Mar 7, 2024
dd9ffe4
Consolidate `Session` into `UserProperty`
eliasyishak Mar 8, 2024
0052d71
Sort members + swap error messages for tests
eliasyishak Mar 8, 2024
9394d29
`dart format .`
eliasyishak Mar 8, 2024
f0d110e
Fix tests + note a TODO for `package:file`
eliasyishak Mar 8, 2024
173d5d8
`..run()`
eliasyishak Mar 9, 2024
d742315
Remove `UserProperty.initialize` method
eliasyishak Mar 11, 2024
1aea010
Remove `ErrorHandler` + no late for userprop and loghandler
eliasyishak Mar 11, 2024
75c560c
Fix test
eliasyishak Mar 11, 2024
37fd0de
Make userprop variable private
eliasyishak Mar 11, 2024
f366922
Move configHandler to constructor initializer
eliasyishak Mar 11, 2024
28807e4
Remove unnecessary parameters for log handler
eliasyishak Mar 11, 2024
20f31c0
Add'l documentation
eliasyishak Mar 11, 2024
227d5f5
Remove unused params for survey handler
eliasyishak Mar 11, 2024
9415f98
Changelog update + dartdocs
eliasyishak Mar 11, 2024
721a2c4
Bump version to `6.0.0`
eliasyishak Mar 11, 2024
7b93ae2
Merge branch 'main' into remove-late-variables
eliasyishak Mar 11, 2024
a5fb177
Remove `Initializer` abstraction, sub for functions
eliasyishak Mar 12, 2024
30623bc
Fix test for session file modified timestamp
eliasyishak Mar 12, 2024
15950fa
Remove `sessionIdOverride` for session initializer
eliasyishak Mar 12, 2024
5b4ae34
Clean up CHANGELOG
eliasyishak Mar 12, 2024
7893a14
Merge branch 'main' into remove-late-variables
eliasyishak Mar 14, 2024
1ff5e94
Merge remote-tracking branch 'upstream/main' into remove-late-variables
eliasyishak Mar 15, 2024
37d29d7
Fix failing test
eliasyishak Mar 15, 2024
75ec878
Format fix
eliasyishak Mar 15, 2024
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
9 changes: 8 additions & 1 deletion pkgs/unified_analytics/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 6.0.0-wip

- Consolidate `Session` functionality into `UserProperty` to prevent race condition crash where session logic crashed before initializing `UserProperty`
- Get rid of `late` variables throughout implementation class, `AnalyticsImpl`
- Any error events (`Event.analyticsException`) encountered within package will be sent when invoking `Analytics.close`; replacing `ErrorHandler` functionality
- Exposing new method for `FakeAnalytics.sendPendingErrorEvents` to send error events on command

## 5.8.8

- [Bug fix](https://github.com/dart-lang/tools/issues/252) rewrite the other call site for the session file
Expand All @@ -8,7 +15,7 @@

## 5.8.6

- Refactored session handler class to use the last modified timestamp as the last ping value
- Refactored session handler class to use the last modified timestamp as the last ping value to prevent writing to file with each send
- Bumping intl package to 0.19.0 to fix version solving issue with flutter_tools

## 5.8.5
Expand Down
8 changes: 6 additions & 2 deletions pkgs/unified_analytics/example/serving_surveys.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import 'package:clock/clock.dart';
import 'package:file/file.dart';
import 'package:file/memory.dart';
import 'package:path/path.dart' as p;

import 'package:unified_analytics/src/constants.dart';
import 'package:unified_analytics/src/enums.dart';
Expand Down Expand Up @@ -57,8 +58,11 @@ void main() async {
fs: fs,
platform: DevicePlatform.macos,
surveyHandler: FakeSurveyHandler.fromList(
homeDirectory: home,
fs: fs,
dismissedSurveyFile: fs.file(p.join(
home.path,
kDartToolDirectoryName,
kDismissedSurveyFileName,
)),
initializedSurveys: [
Survey(
uniqueId: 'uniqueId',
Expand Down
Loading