Skip to content

Commit

Permalink
submit date-time in UTC format (#4)
Browse files Browse the repository at this point in the history
* submit date-time in UTC format

* version bump and changelog

* change dep version to unblock pub get
  • Loading branch information
yjbanov committed Sep 18, 2017
1 parent e3945aa commit 0f2131f
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# package:sentry changelog

## 0.0.6

This comment has been minimized.

Copy link
@DisDis

DisDis Oct 4, 2017

Hi @yjbanov .
Wrike recently published a library for working with sentry. Let's try to join forces to make one excellent library.
We are ready to consider any proposals for improvement and collaboration.

https://github.com/wrike/sentry_client
https://pub.dartlang.org/packages/sentry_client


- 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
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://github.com/flutter/flutter/issues/new
6 changes: 5 additions & 1 deletion lib/sentry.dart
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
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
@@ -1,18 +1,18 @@
name: sentry
version: 0.0.5
version: 0.0.6
description: A pure Dart Sentry.io client.
author: Flutter Authors <flutter-dev@googlegroups.com>
homepage: https://github.com/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
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 ./

0 comments on commit 0f2131f

Please sign in to comment.