From 019c007577269f0bf1086dbcce398804966a9699 Mon Sep 17 00:00:00 2001 From: Dillon Nys <24740863+dnys1@users.noreply.github.com> Date: Thu, 17 Oct 2024 07:50:45 -0700 Subject: [PATCH] fix(runtime): Fix expectation of trace context when running in cloud (#228) --- packages/celest/CHANGELOG.md | 4 ++++ packages/celest/lib/src/core/context.dart | 2 +- packages/celest/pubspec.yaml | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/celest/CHANGELOG.md b/packages/celest/CHANGELOG.md index 14468cf..cbbf98f 100644 --- a/packages/celest/CHANGELOG.md +++ b/packages/celest/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.0.1+1 + +- fix: Fix expectation of trace context when running in cloud + ## 1.0.1 - chore: Remove assumptions about where the project is deployed diff --git a/packages/celest/lib/src/core/context.dart b/packages/celest/lib/src/core/context.dart index f44340d..4e1a802 100644 --- a/packages/celest/lib/src/core/context.dart +++ b/packages/celest/lib/src/core/context.dart @@ -122,7 +122,7 @@ final class Context { shelf.Request get currentRequest => expect(ContextKey.currentRequest); /// The [Traceparent] for the current request. - Traceparent get currentTrace => expect(ContextKey.currentTrace); + Traceparent? get currentTrace => get(ContextKey.currentTrace); /// The Celest [Environment] of the running service. Environment get environment => expect(env.environment) as Environment; diff --git a/packages/celest/pubspec.yaml b/packages/celest/pubspec.yaml index 383258b..9684819 100644 --- a/packages/celest/pubspec.yaml +++ b/packages/celest/pubspec.yaml @@ -1,6 +1,6 @@ name: celest description: The Flutter cloud platform. Celest enables you to build your entire backend in Dart. -version: 1.0.1 +version: 1.0.1+1 homepage: https://celest.dev repository: https://github.com/celest-dev/celest/tree/main/packages/celest