Skip to content

ref!: Make clone() internal and remove deprecated protocol clones#3845

Open
buenaflor wants to merge 1 commit into
v10-branchfrom
ref/make-clone-internal
Open

ref!: Make clone() internal and remove deprecated protocol clones#3845
buenaflor wants to merge 1 commit into
v10-branchfrom
ref/make-clone-internal

Conversation

@buenaflor

@buenaflor buenaflor commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Two related clone() cleanups for v10:

  • Hub/Scope/NoOpHub/HubAdapter/Sentry.clone() are now @internal. They exist only for SDK-internal scope/hub duplication; no user or cross-package code calls them.
  • The protocol clone() methods (Contexts and its device/os/app/browser/culture/gpu/runtime/response/trace/feedback/flags children) are removed. They were already @Deprecated, and formed a dead subtree — only called from within Contexts.clone(), which itself had no remaining callers. The alias-only "clone context" test is dropped.

Part of the v10 cleanup (#3487).

Breaking change: deprecated protocol clone() is removed (migration: assign directly / use copyWith where still present); Hub/Scope.clone() become @internal — low impact, direct calls were rare.

Fixes #3824

clone() on Hub, Scope, NoOpHub, HubAdapter and Sentry is intended
for SDK-internal use only, so mark it @internal.

The protocol clone() methods (Contexts and its children) were already
@deprecated and formed a dead subtree with no remaining callers, so
remove them along with the alias-only clone context test.

BREAKING CHANGE: The deprecated clone() on protocol classes is removed,
and clone() on Hub/Scope is now @internal.

Fixes GH-3824
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Semver Impact of This PR

🔴 Major (breaking changes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


Breaking Changes

  • Make clone() internal and remove deprecated protocol clones by buenaflor in #3845

Features

  • (grpc) Add integration support for GRPC by lucas-zimerman in #3721

Fixes

  • Correct feature flag scope buffer updates by denrase in #3797

Dependencies

Deps

  • chore(deps): update Android SDK to v8.46.0 by github-actions in #3793
  • chore(deps): update Native SDK to v0.15.2 by github-actions in #3785

Internal Changes

  • (skills) Expand test-guidelines and drop stale deps by buenaflor in #3807
  • Add PR template checkbox for cross sdk review on public API changes by antonis in #3822
  • Block manual CHANGELOG.md edits by buenaflor in #3810
  • Fix Dependabot pub paths and pin GitHub Action by buenaflor in #3804
  • Add AI Use section to CONTRIBUTING.md by christophaigner in #3803

🤖 This preview updates automatically when you update the PR.

@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 20.00000% with 4 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (v10-branch@59d7c7b). Learn more about missing BASE report.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/dart/lib/src/hub.dart 0.00% 1 Missing ⚠️
packages/dart/lib/src/hub_adapter.dart 0.00% 1 Missing ⚠️
packages/dart/lib/src/noop_hub.dart 0.00% 1 Missing ⚠️
packages/dart/lib/src/sentry.dart 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             v10-branch    #3845   +/-   ##
=============================================
  Coverage              ?   87.43%           
=============================================
  Files                 ?      337           
  Lines                 ?    12114           
  Branches              ?        0           
=============================================
  Hits                  ?    10592           
  Misses                ?     1522           
  Partials              ?        0           
Flag Coverage Δ
sentry 87.31% <20.00%> (?)
sentry_dio 97.73% <ø> (?)
sentry_drift 93.57% <ø> (?)
sentry_file 65.29% <ø> (?)
sentry_firebase_remote_config 100.00% <ø> (?)
sentry_flutter 91.66% <ø> (?)
sentry_grpc 99.09% <ø> (?)
sentry_hive 77.48% <ø> (?)
sentry_isar 74.37% <ø> (?)
sentry_link 21.50% <ø> (?)
sentry_logging 97.01% <ø> (?)
sentry_sqflite 88.81% <ø> (?)
sentry_supabase 97.27% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@buenaflor buenaflor marked this pull request as ready for review July 1, 2026 15:10
@buenaflor buenaflor requested a review from denrase as a code owner July 1, 2026 15:10
Copilot AI review requested due to automatic review settings July 1, 2026 15:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR performs v10 cleanup of clone() usage by restricting hub/scope cloning APIs to SDK-internal use and removing deprecated protocol clone() methods that no longer have callers.

Changes:

  • Mark Hub.clone(), Scope.clone(), NoOpHub.clone(), HubAdapter.clone(), and Sentry.clone() as @internal.
  • Remove deprecated protocol clone() methods for Contexts and its child protocol types.
  • Remove the now-obsolete clone context unit test.

Reviewed changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/dart/test/contexts_test.dart Drops the clone()-focused test that no longer applies after protocol clone removals.
packages/dart/lib/src/sentry.dart Marks Sentry.clone() as @internal.
packages/dart/lib/src/scope.dart Marks Scope.clone() as @internal.
packages/dart/lib/src/protocol/sentry_trace_context.dart Removes deprecated SentryTraceContext.clone().
packages/dart/lib/src/protocol/sentry_runtime.dart Removes deprecated SentryRuntime.clone().
packages/dart/lib/src/protocol/sentry_response.dart Removes deprecated SentryResponse.clone().
packages/dart/lib/src/protocol/sentry_operating_system.dart Removes deprecated SentryOperatingSystem.clone().
packages/dart/lib/src/protocol/sentry_gpu.dart Removes deprecated SentryGpu.clone().
packages/dart/lib/src/protocol/sentry_feedback.dart Removes deprecated SentryFeedback.clone().
packages/dart/lib/src/protocol/sentry_feature_flags.dart Removes deprecated SentryFeatureFlags.clone().
packages/dart/lib/src/protocol/sentry_feature_flag.dart Removes deprecated SentryFeatureFlag.clone().
packages/dart/lib/src/protocol/sentry_device.dart Removes deprecated SentryDevice.clone().
packages/dart/lib/src/protocol/sentry_culture.dart Removes deprecated SentryCulture.clone().
packages/dart/lib/src/protocol/sentry_browser.dart Removes deprecated SentryBrowser.clone().
packages/dart/lib/src/protocol/sentry_app.dart Removes deprecated SentryApp.clone().
packages/dart/lib/src/protocol/contexts.dart Removes deprecated Contexts.clone() implementation.
packages/dart/lib/src/noop_hub.dart Marks NoOpHub.clone() as @internal.
packages/dart/lib/src/hub.dart Marks Hub.clone() as @internal.
packages/dart/lib/src/hub_adapter.dart Marks HubAdapter.clone() as @internal.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants