Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions sentry-android-navigation3/api/sentry-android-navigation3.api
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,45 @@ public final class io/sentry/compose/navigation3/BuildConfig {
public fun <init> ()V
}

public abstract interface class io/sentry/compose/navigation3/RouteArgumentsExtractor {
public abstract fun extract (Ljava/lang/Object;)Ljava/util/Map;
}

public abstract interface class io/sentry/compose/navigation3/RouteNameExtractor {
public abstract fun extract (Ljava/lang/Object;)Ljava/lang/String;
}

public final class io/sentry/compose/navigation3/SentryNavEffectKt {
public static final fun SentryNavEffect (Ljava/util/List;Lio/sentry/compose/navigation3/RouteNameExtractor;Lio/sentry/compose/navigation3/RouteArgumentsExtractor;Lio/sentry/compose/navigation3/SentryNavOptions;Landroidx/compose/runtime/Composer;II)V
}

public final class io/sentry/compose/navigation3/SentryNavOptions {
public static final field $stable I
public synthetic fun <init> (ZZZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun equals (Ljava/lang/Object;)Z
public final fun getCaptureBackStack ()Z
public final fun getEnableNavigationBreadcrumbs ()Z
public final fun getEnableNavigationTransactions ()Z
public final fun getMaxCapturedBackStackEntries ()I
public fun hashCode ()I
}

public final class io/sentry/compose/navigation3/SentryNavOptions$Builder {
public static final field $stable I
public fun <init> ()V
public final fun build ()Lio/sentry/compose/navigation3/SentryNavOptions;
public final fun getCaptureBackStack ()Z
public final fun getEnableNavigationBreadcrumbs ()Z
public final fun getEnableNavigationTransactions ()Z
public final fun getMaxCapturedBackStackEntries ()I
public final fun setCaptureBackStack (Z)V
public final fun setEnableNavigationBreadcrumbs (Z)V
public final fun setEnableNavigationTransactions (Z)V
public final fun setMaxCapturedBackStackEntries (I)V
}

public final class io/sentry/compose/navigation3/SentryNavOptionsKt {
public static final fun SentryNavOptions (Lkotlin/jvm/functions/Function1;)Lio/sentry/compose/navigation3/SentryNavOptions;
public static synthetic fun SentryNavOptions$default (Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lio/sentry/compose/navigation3/SentryNavOptions;
}

Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ import org.jetbrains.annotations.ApiStatus
* [RouteArgumentsExtractor].
*/
@ApiStatus.Experimental
internal fun interface RouteNameExtractor<T : Any> {
fun extract(backStackEntry: T): String
@ApiStatus.Internal
public fun interface RouteNameExtractor<T : Any> {
public fun extract(backStackEntry: T): String
}

/**
Expand Down Expand Up @@ -110,8 +111,9 @@ internal fun interface RouteNameExtractor<T : Any> {
* ```
*/
@ApiStatus.Experimental
internal fun interface RouteArgumentsExtractor<T : Any> {
fun extract(backStackEntry: T): Map<String, Any?>
@ApiStatus.Internal
public fun interface RouteArgumentsExtractor<T : Any> {
public fun extract(backStackEntry: T): Map<String, Any?>
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ import org.jetbrains.annotations.ApiStatus
* @param options The kinds of navigation info this effect should record.
*/
@ApiStatus.Experimental
@ApiStatus.Internal
@Composable
@Suppress("FunctionNaming")
internal fun <T : Any> SentryNavEffect(
public fun <T : Any> SentryNavEffect(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Contradictory public API status annotations

Low Severity

SentryNavEffect and its parameter types are annotated with both @ApiStatus.Experimental and @ApiStatus.Internal. Those markers conflict: Internal means the API is not for host apps, while Experimental means it is public but unstable. The PR presents this as the integration surface host apps will use.

Additional Locations (2)
Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bugbot

Reviewed by Cursor Bugbot for commit 323c163. Configure here.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not sure what our convention here is, and happy to conform as needed.

This PR is meant to make SentryNavEffect public exclusively for our sample apps; official publication will come later, accompanied by a CHANGELOG entry, etc., at which point these APIs will still be experimental.

backStack: List<T>,
nameExtractor: RouteNameExtractor<T>,
argumentsExtractor: RouteArgumentsExtractor<T>? = null,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@ private const val DEFAULT_MAX_CAPTURED_BACK_STACK_ENTRIES = 10
* ```
*/
@ApiStatus.Experimental
@ApiStatus.Internal
@Immutable
internal class SentryNavOptions
public class SentryNavOptions
private constructor(
val enableNavigationBreadcrumbs: Boolean,
val enableNavigationTransactions: Boolean,
val captureBackStack: Boolean,
val maxCapturedBackStackEntries: Int,
public val enableNavigationBreadcrumbs: Boolean,
public val enableNavigationTransactions: Boolean,
public val captureBackStack: Boolean,
public val maxCapturedBackStackEntries: Int,
) {

init {
Expand All @@ -41,26 +42,26 @@ private constructor(
* Lets us keep the resulting instance [Immutable] while preserving binary compatibility, should
* new properties be added in the future.
*/
class Builder {
public class Builder {

/**
* Whether navigation should produce Sentry breadcrumbs. If `true`, a new nav destination
* generates a breadcrumb like `from=/Home` and `to=/Profile`.
*/
var enableNavigationBreadcrumbs: Boolean = true
public var enableNavigationBreadcrumbs: Boolean = true

/**
* Whether navigation should start a Sentry transaction. If `true`, navigating from `/Home` to
* `/Profile` starts a `/Profile` transaction and finishes the current `/Home` transaction.
*/
var enableNavigationTransactions: Boolean = true
public var enableNavigationTransactions: Boolean = true

/**
* Whether Sentry should record back stack information for inclusion with crashes, errors, and
* other captured events. If `true`, a stack like `/Home -> /Profile` is recorded alongside the
* event, ordered with the current/top entry first.
*/
var captureBackStack: Boolean = true
public var captureBackStack: Boolean = true

/**
* Maximum number of entries Sentry should record per captured back stack (starting with the
Expand All @@ -70,9 +71,9 @@ private constructor(
* whenever your back stack changes. Keep name and argument extractors lightweight, and reduce
* the max captured count if extractor work is unusually expensive.
*/
var maxCapturedBackStackEntries: Int = DEFAULT_MAX_CAPTURED_BACK_STACK_ENTRIES
public var maxCapturedBackStackEntries: Int = DEFAULT_MAX_CAPTURED_BACK_STACK_ENTRIES

fun build(): SentryNavOptions =
public fun build(): SentryNavOptions =
SentryNavOptions(
enableNavigationBreadcrumbs = enableNavigationBreadcrumbs,
enableNavigationTransactions = enableNavigationTransactions,
Expand Down Expand Up @@ -100,6 +101,6 @@ private constructor(

/** Creates [SentryNavOptions]. Optionally configure it via [configure]. */
@ApiStatus.Experimental
internal fun SentryNavOptions(
configure: SentryNavOptions.Builder.() -> Unit = {}
): SentryNavOptions = SentryNavOptions.Builder().apply(configure).build()
@ApiStatus.Internal
public fun SentryNavOptions(configure: SentryNavOptions.Builder.() -> Unit = {}): SentryNavOptions =
SentryNavOptions.Builder().apply(configure).build()
Loading