-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
make app ids more unique #6113
make app ids more unique #6113
Conversation
@@ -6,6 +6,8 @@ import 'dart:async'; | |||
import 'dart:convert'; | |||
import 'dart:io'; | |||
|
|||
import 'package:usage/src/uuid.dart'; // ignore: implementation_imports |
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.
Frown
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.
Maybe it would be better to duplicate this code instead of importing something private? It looks pretty self-contained.
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.
I maintain package:usage
, so while this is a bit of a shortcut I felt not much risk of APIs changing out from under us.
But I can inline the class - it is self-contained and small.
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.
Maybe package:usage should export it in its API?
Anyway, its up to you.
LGTM |
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.
LGTM.
@@ -6,6 +6,8 @@ import 'dart:async'; | |||
import 'dart:convert'; | |||
import 'dart:io'; | |||
|
|||
import 'package:usage/src/uuid.dart'; // ignore: implementation_imports |
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.
I agree with Adam that it would be cleaner if the package exported the needed API.
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.
I'll inline this for now and file an issue to expose the API in usage
.
When returning launched app ids to clients, instead of generating ids using an increasing number (
app-1
,app-2
, ...), use 128bit uuids. This makes them unique across daemon instances, which can be useful to clients that use multiple daemon instances.@danrubel, /cc @stevemessick