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

fix(internal): Lower constraints when retrieving _internal #1469

Merged
merged 1 commit into from
Sep 14, 2023

Conversation

fuzzybinary
Copy link
Member

What and why?

RUMMonitorProtocol._internal required that self be the type Monitor before creating the DatadogInternalInterface. This was overspecialization and made it hard to mock internal calls. By casting only to RUMCommandSubscriber we can more easily create mocks for testing.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)
  • Make sure each commit and the PR mention the Issue number or JIRA reference
  • Add CHANGELOG entry for user facing changes

Custom CI job configuration (optional)

  • Run unit tests
  • Run integration tests
  • Run smoke tests

@fuzzybinary fuzzybinary requested a review from a team as a code owner September 13, 2023 12:50
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Sep 13, 2023

Datadog Report

Branch report: jward/internal-cast
Commit report: 069fb6d

dd-sdk-ios: 0 Failed, 0 New Flaky, 158 Passed, 0 Skipped, 13m 25.67s Wall Time

Copy link
Member

@maxep maxep left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

`RUMMonitorProtocol._internal` required that self be the type `Monitor` before creating the DatadogInternalInterface. This was overspecialization and made it hard to mock internal calls. By casting only to `RUMCommandSubscriber` we can more easily create mocks for testing.
@fuzzybinary fuzzybinary merged commit 743003f into develop Sep 14, 2023
@fuzzybinary fuzzybinary deleted the jward/internal-cast branch March 5, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants