Skip to content

Collapse Envelope.FromTransaction overloads into a single method with optional parameters #5397

Closed

Description

@jamescrosswell

Background

Follow-up from #5182 (review).

Envelope.FromTransaction is currently split into two overloads:

public static Envelope FromTransaction(SentryTransaction transaction) =>
    FromTransaction(transaction, null, null);

public static Envelope FromTransaction(
    SentryTransaction transaction,
    IDiagnosticLogger? logger,
    IReadOnlyCollection<SentryAttachment>? attachments)

The sibling factory methods FromEvent and FromFeedback instead expose a single method with optional parameters defaulting to null:

public static Envelope FromFeedback(
    SentryEvent @event,
    IDiagnosticLogger? logger = null,
    IReadOnlyCollection<SentryAttachment>? attachments = null,
    SessionUpdate? sessionUpdate = null)

As @bitsandfoxes noted, collapsing FromTransaction into a single method with optional parameters would bring it in line with the rest.

Proposal

Replace the two FromTransaction overloads with a single method:

public static Envelope FromTransaction(
    SentryTransaction transaction,
    IDiagnosticLogger? logger = null,
    IReadOnlyCollection<SentryAttachment>? attachments = null)

Activity

  1. added this to the 7.0.0 milestone on Jul 16, 2026
  2. added
    public APIAdditions/modifications to, or removals from, the public API surface area.
    Breaking ChangeBinary/Source/Behavioral Breaking Changes.
    on Jul 16, 2026
  3. linear-code commented on Jul 16, 2026

    @linear-code
  4. added a commit that references this issue on Jul 17, 2026
    2496a53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Breaking ChangeBinary/Source/Behavioral Breaking Changes.Next MajorChanges scheduled for the next Major release.public APIAdditions/modifications to, or removals from, the public API surface area.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions