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

implement error-metrics network call #10

Merged
merged 7 commits into from
Sep 18, 2024

Conversation

andresilveirah
Copy link
Member

@andresilveirah andresilveirah commented Sep 13, 2024

In this PR we:

  • implement the /custom-metrics network call
  • gather information about the device / os, depending on the platform
  • use that information in the call to /custom-metrics
  • "automatically" call /custom-metrics if:
    • there's a network error (response.status != 2xx)
    • the response body can't be parsed into the expected Body type

import kotlinx.serialization.Serializable

@Suppress("unused") // properties are used in every request inheriting from DefaultRequest
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for comments 👍

@Test
fun containsTheRightAttributes() = runTest {
val request = DefaultRequest()
assertEquals("mobile-core-tvOS", request.scriptType)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure but tvOS should not be the default value?

import kotlin.test.Test
import kotlin.test.assertEquals

class DefaultRequestTest {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I suggest renaming or merging 2 classes with same name DefaultRequestTest

@andresilveirah andresilveirah merged commit d53bcd7 into main Sep 18, 2024
2 checks passed
@andresilveirah andresilveirah deleted the implement_error-metrics_call branch September 18, 2024 16:14
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