Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
523afbe5
Unverified
Commit
523afbe5
authored
Jul 24, 2020
by
Zachary Anderson
Committed by
GitHub
Jul 24, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ensure analytics are sent before disabling (#62094)
parent
7877d46c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
config.dart
packages/flutter_tools/lib/src/commands/config.dart
+8
-2
config_test.dart
...utter_tools/test/commands.shard/hermetic/config_test.dart
+3
-0
No files found.
packages/flutter_tools/lib/src/commands/config.dart
View file @
523afbe5
...
...
@@ -113,9 +113,15 @@ class ConfigCommand extends FlutterCommand {
if
(
argResults
.
wasParsed
(
'analytics'
))
{
final
bool
value
=
boolArg
(
'analytics'
);
//
We send the analytics event *before* toggling the flag intentionally
// to be sure that opt-out events are sent correctly.
//
The tool sends the analytics event *before* toggling the flag
//
intentionally
to be sure that opt-out events are sent correctly.
AnalyticsConfigEvent
(
enabled:
value
).
send
();
if
(!
value
)
{
// Normally, the tool waits for the analytics to all send before the
// tool exits, but only when analytics are enabled. When reporting that
// analytics have been disable, the wait must be done here instead.
await
globals
.
flutterUsage
.
ensureAnalyticsSent
();
}
globals
.
flutterUsage
.
enabled
=
value
;
globals
.
printStatus
(
'Analytics reporting
${value ? 'enabled' : 'disabled'}
.'
);
}
...
...
packages/flutter_tools/test/commands.shard/hermetic/config_test.dart
View file @
523afbe5
...
...
@@ -233,6 +233,9 @@ void main() {
expect
(
mockUsage
.
enabled
,
false
);
// Verify that we flushed the analytics queue.
verify
(
mockUsage
.
ensureAnalyticsSent
());
// Verify that we only send the analytics disable event, and no other
// info.
verifyNever
(
mockUsage
.
sendCommand
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment