Skip to content

Commit

Permalink
Pull request #204: RUM-10777 Change sendBizEvent behavior
Browse files Browse the repository at this point in the history
Merge in OP/openkit-native from feature/RUM-10777-openkit-sendbizevent-is-not-checking-against-the-correct-datacollectionlevel to main

* commit '7c03a217208b5377e45587b78ab9380d9c8930a8':
  RUM-10777 Change sendBizEvent behavior

GitOrigin-RevId: 5a91682a959e3ade417863449773351a7c3cbb4b
  • Loading branch information
TheHighriser authored and openkitdt committed Nov 30, 2023
1 parent 28d688b commit 0349f4b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 23 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## [Unreleased](https://github.com/Dynatrace/openkit-native/compare/v3.1.0...HEAD)

### Changed
- `Session.sendBizEvent` will always send an event regardless of the `DataCollectionLevel`

## 3.1.0 [Release date: 2023-06-05]
[GitHub Releases](https://github.com/Dynatrace/openkit-native/releases/tag/v3.1.0)

Expand Down
5 changes: 0 additions & 5 deletions src/protocol/Beacon.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -626,11 +626,6 @@ void Beacon::sendBizEvent(const core::UTF8String& type, const openkit::json::Jso
throw std::invalid_argument("type.empty() is true");
}

if (!mBeaconConfiguration->getPrivacyConfiguration()->isEventReportingAllowed())
{
return;
}

if (!isDataCapturingEnabled())
{
return;
Expand Down
18 changes: 0 additions & 18 deletions test/protocol/BeaconTest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2681,24 +2681,6 @@ TEST_F(BeaconTest, sendBizEventNotReportedIfDataSendingDisallowed)
target->sendBizEvent(eventType, emptyMap);
}

TEST_F(BeaconTest, sendBizEventNotReportedIfSendingEventDataDisallowed)
{
// with
ON_CALL(*mockPrivacyConfiguration, isEventReportingAllowed())
.WillByDefault(testing::Return(false));

Utf8String_t eventType("event type");
auto emptyMap = std::make_shared<openkit::json::JsonObjectValue::JsonObjectMap>();
auto target = createBeacon()->build();

// expect
EXPECT_CALL(*mockBeaconCache, addEventData(testing::_, testing::_, testing::_))
.Times(0);

// when, expect no interaction with beacon cache
target->sendBizEvent(eventType, emptyMap);
}

TEST_F(BeaconTest, sendBizEventNotReportIfDisallowedByTrafficControl)
{
// expect
Expand Down

0 comments on commit 0349f4b

Please sign in to comment.