Skip to content
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

submit date-time in UTC format #4

Merged
merged 3 commits into from
Sep 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# package:sentry changelog

## 0.0.6

- use UTC in the `timestamp` field

## 0.0.5

- remove sub-seconds from the timestamp
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ main() async {

[run_zoned]: https://api.dartlang.org/stable/1.24.1/dart-async/runZoned.html
[flutter_error]: https://docs.flutter.io/flutter/foundation/FlutterError/onError.html

## Found a bug?

Please file it at https:/flutter/flutter/issues/new
6 changes: 5 additions & 1 deletion lib/sentry.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class SentryClient {
UuidGenerator uuidGenerator,
}) {
httpClient ??= new Client();
clock ??= const Clock();
clock ??= const Clock(_getUtcDateTime);
uuidGenerator ??= _generateUuidV4WithoutDashes;
compressPayload ??= true;

Expand Down Expand Up @@ -262,6 +262,10 @@ class SeverityLevel {
final String name;
}

/// Sentry does not take a timezone and instead expects the date-time to be
/// submitted in UTC timezone.
DateTime _getUtcDateTime() => new DateTime.now().toUtc();

/// An event to be reported to Sentry.io.
@immutable
class Event {
Expand Down
2 changes: 1 addition & 1 deletion lib/src/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
library version;

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

/// The SDK name reported to Sentry.io in the submitted events.
const String sdkName = 'dart';
Expand Down
18 changes: 9 additions & 9 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
name: sentry
version: 0.0.5
version: 0.0.6
description: A pure Dart Sentry.io client.
author: Flutter Authors <[email protected]>
homepage: https:/flutter/sentry

dependencies:
http: ">=0.11.3+13 <2.0.0"
meta: ">=1.0.5 <2.0.0"
http: ">=0.11.0 <2.0.0"
meta: ">=1.0.0 <2.0.0"
quiver: ">=0.25.0 <2.0.0"
stack_trace: ">=1.7.3 <2.0.0"
usage: ">=3.1.1 <4.0.0"
stack_trace: ">=1.0.0 <2.0.0"
usage: ">=3.0.0 <4.0.0"

dev_dependencies:
args: ">=0.13.7 <2.0.0"
test: ">=0.12.21 <2.0.0"
yaml: ">=2.1.12 <3.0.0"
mockito: ">=2.0.2 <3.0.0"
args: ">=0.13.0 <2.0.0"
test: ">=0.12.0 <2.0.0"
yaml: ">=2.1.0 <3.0.0"
mockito: ">=2.0.0 <3.0.0"
1 change: 1 addition & 0 deletions tool/presubmit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
set -e
set -x

pub get
dartanalyzer --strong --fatal-warnings ./
pub run test --platform vm
dartfmt -n --set-exit-if-changed ./