Skip to content

Commit 475727f

Browse files
committed
feat: Update to event schema v4 (#192)
1 parent 2c05c8d commit 475727f

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

src/LaunchDarkly/Impl/Util.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,9 @@ public static function eventHeaders(string $sdkKey, $applicationInfo): array
126126
{
127127
$headers = Util::defaultHeaders($sdkKey, $applicationInfo);
128128
$headers['X-LaunchDarkly-Event-Schema'] = EventPublisher::CURRENT_SCHEMA_VERSION;
129+
// Only the presence of this header is important. We encode a string
130+
// value of 'true' to ensure it isn't dropped along the way.
131+
$headers['X-LaunchDarkly-Unsummarized'] = 'true';
129132

130133
return $headers;
131134
}

src/LaunchDarkly/Subsystems/EventPublisher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ interface EventPublisher
1818
* @var int
1919
* @ignore
2020
*/
21-
const CURRENT_SCHEMA_VERSION = 2;
21+
const CURRENT_SCHEMA_VERSION = 4;
2222

2323
/**
2424
* @param string $sdkKey The SDK key for your account

tests/Impl/Integrations/EventPublisherTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public function testSendsCorrectBodyAndHeaders($publisher)
8888
$this->assertEquals('sdk-key', $headers['Authorization']);
8989
$this->assertEquals('PHPClient/' . LDClient::VERSION, $headers['User-Agent']);
9090
$this->assertEquals(EventPublisher::CURRENT_SCHEMA_VERSION, $headers['X-LaunchDarkly-Event-Schema']);
91+
$this->assertArrayHasKey('X-LaunchDarkly-Unsummarized', $headers);
9192
$this->assertEquals('application-id/my-id application-version/my-version', $headers['X-LaunchDarkly-Tags']);
9293
}
9394
}

0 commit comments

Comments
 (0)