Skip to content

Conversation

runningcode
Copy link
Contributor

@runningcode runningcode commented Oct 10, 2025

Summary

This PR:

  1. Adds support for the build_configuration parameter in the Android distribution check-for-updates API
  2. Fixes response parsing to use snake_case to match the actual backend responses
  3. Adds toString() methods for easier debugging

#skip-changelog since this is for an unreleased feature

…esponse parsing

- Add required buildConfiguration parameter to UpdateCheckParams
- Update checkForUpdates to include build_configuration query parameter
- Add debug logging to print full URL for debugging
- Fix response parser to use correct backend format (update object instead of updateAvailable boolean)
- Fix response parser to use snake_case field names to match backend API
- Add toString methods to UpdateInfo and UpdateStatus classes for better debugging
- Update all tests to match new response format

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

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

github-actions bot commented Oct 10, 2025

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

Generated by 🚫 dangerJS against ad4961a

@runningcode runningcode requested a review from chromy October 10, 2025 15:01
@runningcode runningcode changed the title feat(android-distribution): Add build_configuration support and fix response parsing feat(android-distribution): Add build_configuration support and use snake_case for parsing responses Oct 10, 2025
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Bug: Case Mismatch in Validation Logic

The validation logic for missing fields in parseUpdateInfo uses camelCase names (e.g., buildVersion, downloadUrl), but the API response and parsing now expect snake_case (e.g., build_version, download_url). This mismatch creates confusing error messages.

sentry-android-distribution/src/main/java/io/sentry/android/distribution/UpdateResponseParser.kt#L67-L75

if (buildVersion.isEmpty() || buildVersion == "null") {
missingFields.add("buildVersion")
}
if (downloadUrl.isEmpty() || downloadUrl == "null") {
missingFields.add("downloadUrl")
}
if (missingFields.isNotEmpty()) {
throw IllegalArgumentException(

Fix in Cursor Fix in Web


Copy link
Contributor

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 371.68 ms 452.06 ms 80.38 ms
Size 1.58 MiB 2.11 MiB 539.18 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
3998a95 415.94 ms 478.54 ms 62.60 ms
7314dbe 437.83 ms 505.64 ms 67.81 ms
3d205d0 352.15 ms 432.53 ms 80.38 ms
ee747ae 554.98 ms 611.50 ms 56.52 ms
c8125f3 397.65 ms 485.14 ms 87.49 ms
23d6b12 354.10 ms 408.38 ms 54.28 ms
ee747ae 357.79 ms 421.84 ms 64.05 ms
d217708 411.22 ms 430.86 ms 19.63 ms
b3d8889 371.84 ms 447.49 ms 75.65 ms
d217708 375.27 ms 415.68 ms 40.41 ms

App size

Revision Plain With Sentry Diff
3998a95 1.58 MiB 2.10 MiB 532.96 KiB
7314dbe 1.58 MiB 2.10 MiB 533.45 KiB
3d205d0 1.58 MiB 2.10 MiB 532.97 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
c8125f3 1.58 MiB 2.10 MiB 532.32 KiB
23d6b12 1.58 MiB 2.10 MiB 532.31 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB
b3d8889 1.58 MiB 2.10 MiB 535.07 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB

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.

1 participant