Skip to content

Commit 0f2131f

Browse files
authored
submit date-time in UTC format (#4)
* submit date-time in UTC format * version bump and changelog * change dep version to unblock pub get
1 parent e3945aa commit 0f2131f

File tree

6 files changed

+24
-11
lines changed

6 files changed

+24
-11
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# package:sentry changelog
22

3+
## 0.0.6
4+
5+
- use UTC in the `timestamp` field
6+
37
## 0.0.5
48

59
- remove sub-seconds from the timestamp

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,7 @@ main() async {
5050

5151
[run_zoned]: https://api.dartlang.org/stable/1.24.1/dart-async/runZoned.html
5252
[flutter_error]: https://docs.flutter.io/flutter/foundation/FlutterError/onError.html
53+
54+
## Found a bug?
55+
56+
Please file it at https://github.com/flutter/flutter/issues/new

lib/sentry.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class SentryClient {
6060
UuidGenerator uuidGenerator,
6161
}) {
6262
httpClient ??= new Client();
63-
clock ??= const Clock();
63+
clock ??= const Clock(_getUtcDateTime);
6464
uuidGenerator ??= _generateUuidV4WithoutDashes;
6565
compressPayload ??= true;
6666

@@ -262,6 +262,10 @@ class SeverityLevel {
262262
final String name;
263263
}
264264

265+
/// Sentry does not take a timezone and instead expects the date-time to be
266+
/// submitted in UTC timezone.
267+
DateTime _getUtcDateTime() => new DateTime.now().toUtc();
268+
265269
/// An event to be reported to Sentry.io.
266270
@immutable
267271
class Event {

lib/src/version.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
library version;
1010

1111
/// The SDK version reported to Sentry.io in the submitted events.
12-
const String sdkVersion = '0.0.5';
12+
const String sdkVersion = '0.0.6';
1313

1414
/// The SDK name reported to Sentry.io in the submitted events.
1515
const String sdkName = 'dart';

pubspec.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
name: sentry
2-
version: 0.0.5
2+
version: 0.0.6
33
description: A pure Dart Sentry.io client.
44
author: Flutter Authors <[email protected]>
55
homepage: https://github.com/flutter/sentry
66

77
dependencies:
8-
http: ">=0.11.3+13 <2.0.0"
9-
meta: ">=1.0.5 <2.0.0"
8+
http: ">=0.11.0 <2.0.0"
9+
meta: ">=1.0.0 <2.0.0"
1010
quiver: ">=0.25.0 <2.0.0"
11-
stack_trace: ">=1.7.3 <2.0.0"
12-
usage: ">=3.1.1 <4.0.0"
11+
stack_trace: ">=1.0.0 <2.0.0"
12+
usage: ">=3.0.0 <4.0.0"
1313

1414
dev_dependencies:
15-
args: ">=0.13.7 <2.0.0"
16-
test: ">=0.12.21 <2.0.0"
17-
yaml: ">=2.1.12 <3.0.0"
18-
mockito: ">=2.0.2 <3.0.0"
15+
args: ">=0.13.0 <2.0.0"
16+
test: ">=0.12.0 <2.0.0"
17+
yaml: ">=2.1.0 <3.0.0"
18+
mockito: ">=2.0.0 <3.0.0"

tool/presubmit.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -e
44
set -x
55

6+
pub get
67
dartanalyzer --strong --fatal-warnings ./
78
pub run test --platform vm
89
dartfmt -n --set-exit-if-changed ./

0 commit comments

Comments
 (0)