Skip to content

Conversation

@dogi
Copy link
Member

@dogi dogi commented Feb 5, 2026

Removed unnecessary safe calls on non-nullable Retrofit Response objects in UploadToShelfService.kt. This includes res.body(), response.isSuccessful, and simplifying boolean checks. Verified compilation and preserved necessary safe calls where appropriate.


PR created automatically by Jules for task 1057705527000313514 started by @dogi

Refactored `UploadToShelfService.kt` to remove redundant safe call operators (`?.`) on variables that are known to be non-nullable, such as Retrofit `Response` objects.
Specifically:
- Removed `?.` from `Response` objects returned by `ApiInterface` suspend functions (e.g., `res?.body()` -> `res.body()`, `response?.isSuccessful` -> `response.isSuccessful`).
- Simplified boolean checks (e.g., `isSuccessful == true` -> `isSuccessful`).
- Kept necessary safe calls where nullability is introduced (e.g., via `RetryUtils.retry` in `saveKeyIv`).

This cleanup improves code readability and removes unnecessary null checks as per Kotlin's null safety guarantees for Retrofit's `Response<T>`.

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@dogi dogi marked this pull request as ready for review February 5, 2026 18:15
@dogi dogi changed the title Remove unnecessary safe calls in UploadToShelfService sync: less safe calls is more (fixes #11232) Feb 10, 2026
@dogi dogi changed the title sync: less safe calls is more (fixes #11232) sync: less shelf safe calls is more (fixes #11232) Feb 10, 2026
@dogi dogi merged commit 5b930ea into master Feb 10, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants