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

All Android signals are always send with "testMode=true" while iOS works fine #6

Closed
novas1r1 opened this issue Apr 17, 2024 · 9 comments · Fixed by #10
Closed

All Android signals are always send with "testMode=true" while iOS works fine #6

novas1r1 opened this issue Apr 17, 2024 · 9 comments · Fixed by #10

Comments

@novas1r1
Copy link
Contributor

Hey,
I just discovered all my Android signals from my app were put in my "in testing" dashboard, while all iOS signals are correctly displayed in the production board.

iOS:
image

Android:
image

Any idea why?
My implementation looks as follows for both - Android and iOS:

Telemetrydecksdk.start(
      TelemetryManagerConfiguration(
        appID: Config.TELEMETRYDECK_APP_ID,
        testMode: flavor == AppFlavor.dev,
        debug: kDebugMode,
      ),
);

The correct value for testMode is definitely set when sending, I double checked this.

@kkostov
Copy link
Contributor

kkostov commented Apr 28, 2024

@novas1r1 I noticed your comment and I tried to reproduce the faulty behaviour but so far without success.

Just to double check - the issue is that using the following setup results in signals being set as test mode?

Telemetrydecksdk.start(
      TelemetryManagerConfiguration(
        appID: Config.TELEMETRYDECK_APP_ID,
        testMode: false
      ),
);

The behaviour of the library is expected to be as follows:

  • If you do not provide a value for testMode, the Android-specific part of the plugin will default to testMode == false unless the application flag ApplicationInfo.FLAG_DEBUGGABLE is set to true. So if this is a debug build, it will be considered testMode.

In other words, the following will be in test mode for builds where debugging is allowed, but not in test mode for production builds:

Telemetrydecksdk.start(
      TelemetryManagerConfiguration(
        appID: Config.TELEMETRYDECK_APP_ID
      ),
);
  • If you provide a value for testMode, the plugin respects this value when sending signals.

Would it be possible to check if the android release is not configured as "debuggable"? There are several ways this may have been done, e.g., by adding <application android:debuggable="true" to the Android manifest or by adding debuggable true to the BuildType configuration in gradle.

@novas1r1
Copy link
Contributor Author

novas1r1 commented May 3, 2024

Hey @kkostov,
sorry for the late response.

So in my app I tried this:

Telemetrydecksdk.start(
  const TelemetryManagerConfiguration(
    appID: Config.TELEMETRYDECK_APP_ID,
   ),
);

and this:

Telemetrydecksdk.start(
  const TelemetryManagerConfiguration(
    appID: Config.TELEMETRYDECK_APP_ID,
    debug: false,
    testMode: false,
   ),
);

and this:

Telemetrydecksdk.start(
  const TelemetryManagerConfiguration(
    appID: Config.TELEMETRYDECK_APP_ID,
    debug: kDebugMode,
   ),
);

On iOS - everything fine:
image

Android is broken, all signals (not sure, if its all signals, it would have been only 3 users the past 2 weeks, which is definitely not the case as I can see from registrations in Firebase) end up in the test mode.
image

Not sure what else I can try here? I searched for debuggable flags, but couldn't find any. For the release versions I definitely use the --release flag to build the app.

I will try with another project as well.

@novas1r1
Copy link
Contributor Author

novas1r1 commented May 3, 2024

I just checked it for my other app. And I have the same issue there.
IOs seems fine:
image

Android ends up in test mode:
image

Same implementation like above, using the old telemetry version 0.0.5. Above I used my PR and thought I broke something, but seems not to be related.

@kkostov
Copy link
Contributor

kkostov commented May 6, 2024

Thanks @novas1r1 , that looks strange indeed. I will do some more testing and try to narrow it down.

@kkostov
Copy link
Contributor

kkostov commented May 7, 2024

@winsmith I confirmed that the Android SDK is respecting the current mode when setting the isTestMode field. However, the following signals seem to be interpreted as test mode by the server, can you see why that could be?

[
  {
    "receivedAt": "2024-05-07T11:32:24.401Z",
    "appID": "22385f1c-3699-4f04-9d63-24cc0b2e62d8",
    "clientUser": "04f8996da763b7a969b1028ee3007569eaf3a635486ddab211d512c85b9df8fb",
    "sessionID": "5db7d8f1-6307-4d8c-97e5-1c58251e30e7",
    "type": "not_a_test",
    "payload": [
      "dartVersion:3.3.4 (stable) (Tue Apr 16 19:56:12 2024 +0000) on 'android_arm'",
      "telemetryClientVersion:Flutter 0.3.0",
      "appVersion:1.0",
      "systemVersion:Android SDK: 30 (11)",
      "majorSystemVersion:11",
      "majorMinorSystemVersion:11.0",
      "locale:English (United Kingdom)",
      "brand:samsung",
      "targetEnvironment:gta3xlwifi",
      "modelName:SM-T510 (gta3xlwifieea)",
      "architecture:armv8l",
      "operatingSystem:Android"
    ],
    "isTestMode": false
  },
  {
    "receivedAt": "2024-05-07T11:32:24.401Z",
    "appID": "22385f1c-3699-4f04-9d63-24cc0b2e62d8",
    "clientUser": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "sessionID": "5db7d8f1-6307-4d8c-97e5-1c58251e30e7",
    "type": "not_a_test",
    "payload": [
      "dartVersion:3.3.4 (stable) (Tue Apr 16 19:56:12 2024 +0000) on 'android_arm'",
      "telemetryClientVersion:Flutter 0.3.0",
      "appVersion:1.0",
      "systemVersion:Android SDK: 30 (11)",
      "majorSystemVersion:11",
      "majorMinorSystemVersion:11.0",
      "locale:English (United Kingdom)",
      "brand:samsung",
      "targetEnvironment:gta3xlwifi",
      "modelName:SM-T510 (gta3xlwifieea)",
      "architecture:armv8l",
      "operatingSystem:Android"
    ],
    "isTestMode": false
  }
]

@winsmith
Copy link
Contributor

winsmith commented May 7, 2024

Will do, but it'll be tomorrow. Thanks!

@winsmith
Copy link
Contributor

winsmith commented May 7, 2024

Oh wait I see it:

'isTestMode' needs to be a string, either "true" or "false".

A remnant of the old days when our db didn't support any other types

@kkostov
Copy link
Contributor

kkostov commented May 7, 2024

@novas1r1 version 0.4.0 should help address this!

@novas1r1
Copy link
Contributor Author

novas1r1 commented May 8, 2024

Thanks a lot @kkostov - will check on friday and provide feedback :)

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 a pull request may close this issue.

3 participants