Skip to content

Conversation

@runningcode
Copy link
Contributor

@runningcode runningcode commented Sep 30, 2025

Summary

  • Add sentry-android-distribution as debug-only dependency to Android sample
  • Add "Check for Update" button to main activity UI
  • Implement click handler that calls Sentry.distribution().checkForUpdate()
  • Handle all UpdateStatus types: NewRelease, UpToDate, NoNetwork, UpdateError
  • Display results in toast messages

#skip-changelog

Note: This feature requires proper auth tokens and configuration to work. This change makes it easier to test the distribution integration during development.

🤖 Generated with Claude Code


Note

Adds debug-only Sentry Distribution dependency and a "Check for Update" button that calls checkForUpdate and toasts status results.

  • Android sample app:
    • MainActivity (MainActivity.java): Adds click handler for binding.checkForUpdate using Sentry.distribution().checkForUpdate(...); handles UpdateStatus.NewRelease, UpToDate, NoNetwork, UpdateError and shows Toast messages.
    • UI/Resources:
      • Layout (res/layout/activity_main.xml): Adds Button @+id/check_for_update.
      • Strings (res/values/strings.xml): Adds "Check for Update" string.
    • Build (build.gradle.kts): Adds debug-only dependency debugImplementation(projects.sentryAndroidDistribution).

Written by Cursor Bugbot for commit 8842657. This will update automatically on new commits. Configure here.

- Add sentry-android-distribution as debug-only dependency
- Add "Check for Update" button to main activity UI
- Implement handler that calls Sentry.distribution().checkForUpdate()
- Handle all UpdateStatus types: NewRelease, UpToDate, NoNetwork, UpdateError
- Display results in toast messages

Note: This feature requires proper distribution tokens and configuration to work.
This change makes it easier to test the distribution integration.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Sep 30, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 8842657

Toast.makeText(this, message, Toast.LENGTH_LONG).show();
});
});
});
Copy link

Choose a reason for hiding this comment

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

Bug: Debug Dependency Causes Release Build Failures

The checkForUpdate button handler in MainActivity unconditionally calls Sentry.distribution().checkForUpdate() and references UpdateStatus types. Since sentry-android-distribution is a debugImplementation dependency, release builds will encounter compilation errors or runtime crashes when this code is executed.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

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

@runningcode I'm assuming cursor is incorrect here since the Sentry noop impl for sentry-android-distribution implements checkForUpdate to always return UpdateStatus.UpToDate or similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah good to check this. UpdateStatus is part of the api in sentry (not sentry-android-distribution) so it is always there.
The NoOpDistributionApi will be available in release builds that don’t have sentry-android-distribution and this check will always return UpdateStatus.UpToDate

@github-actions
Copy link
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 394.24 ms 435.35 ms 41.11 ms
Size 1.58 MiB 2.10 MiB 533.42 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
b750b96 408.98 ms 480.32 ms 71.34 ms
ee747ae 357.79 ms 421.84 ms 64.05 ms
3998a95 415.94 ms 478.54 ms 62.60 ms
85d7417 347.21 ms 394.35 ms 47.15 ms
806307f 357.85 ms 424.64 ms 66.79 ms
d217708 409.83 ms 474.72 ms 64.89 ms
c8125f3 397.65 ms 485.14 ms 87.49 ms
ee747ae 396.82 ms 441.67 ms 44.86 ms
3699cd5 423.60 ms 495.52 ms 71.92 ms
f634d01 359.58 ms 433.88 ms 74.30 ms

App size

Revision Plain With Sentry Diff
b750b96 1.58 MiB 2.10 MiB 533.19 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
3998a95 1.58 MiB 2.10 MiB 532.96 KiB
85d7417 1.58 MiB 2.10 MiB 533.44 KiB
806307f 1.58 MiB 2.10 MiB 533.42 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB
c8125f3 1.58 MiB 2.10 MiB 532.32 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
3699cd5 1.58 MiB 2.10 MiB 533.45 KiB
f634d01 1.58 MiB 2.10 MiB 533.40 KiB

@runningcode runningcode requested a review from chromy September 30, 2025 09:30
Copy link
Contributor

@chromy chromy left a comment

Choose a reason for hiding this comment

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

lgtm w/ one question on the auto review

Toast.makeText(this, message, Toast.LENGTH_LONG).show();
});
});
});
Copy link
Contributor

Choose a reason for hiding this comment

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

@runningcode I'm assuming cursor is incorrect here since the Sentry noop impl for sentry-android-distribution implements checkForUpdate to always return UpdateStatus.UpToDate or similar?

@runningcode runningcode merged commit 604a261 into main Sep 30, 2025
62 of 66 checks passed
@runningcode runningcode deleted the no/add-distribution-update-check-button branch September 30, 2025 13:02
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.

3 participants