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

Remove unnecessary json adapters #1529

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package io.embrace.android.embracesdk.internal.payload

import com.squareup.moshi.JsonClass

/**
* Included in the payload when the network request capture limit has been exceeded for a
* particular domain. Specifies the limit, and the total count.
*/
@JsonClass(generateAdapter = true)
data class DomainCount(
/** The total count of network calls for the given domain. */
val requestCount: Int,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ class LegacyExceptionInfo(
@Json(name = "length")
val originalLength: Int? = lines.size.takeIf { it > STACK_FRAME_LIMIT }

fun toNewPayload(): ExceptionInfo {
return ExceptionInfo(name, message, lines)
}

companion object {

/**
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,51 +2,11 @@

import com.squareup.moshi.Json
import com.squareup.moshi.JsonClass
import io.embrace.android.embracesdk.internal.capture.crumbs.Breadcrumb
import io.embrace.android.embracesdk.internal.payload.TapBreadcrumb.TapBreadcrumbType

/**
* Breadcrumbs that represent tap events.
*/
@JsonClass(generateAdapter = true)
class TapBreadcrumb(
point: Pair<Float?, Float?>? = null,

/**
* Name of the tapped element.
*/
@Json(name = "tt") val tappedElementName: String?,

/**
* The timestamp at which the event occurred.
*/
@Json(name = "ts")
internal val timestamp: Long,

/**
* Type of TapBreadcrumb that categorizes the kind interaction, based on
* [TapBreadcrumbType] types.
*/
@Json(name = "t") val type: TapBreadcrumbType?
) : Breadcrumb {

/**
* Screen position (coordinates) of the tapped element.
*/
@Json(name = "tl")
var location: String? = null

init {
location = if (point != null) {
val first = point.first?.toInt()?.toFloat() ?: 0.0f
val second = point.second?.toInt()?.toFloat() ?: 0.0f
first.toInt().toString() + "," + second.toInt()
} else {
"0,0"
}
}

override fun getStartTime(): Long = timestamp
class TapBreadcrumb {

Check warning on line 9 in embrace-android-payload/src/main/kotlin/io/embrace/android/embracesdk/internal/payload/TapBreadcrumb.kt

View check run for this annotation

Codecov / codecov/patch

embrace-android-payload/src/main/kotlin/io/embrace/android/embracesdk/internal/payload/TapBreadcrumb.kt#L9

Added line #L9 was not covered by tests

@JsonClass(generateAdapter = false)
enum class TapBreadcrumbType(val value: String) {
Expand Down