Skip to content
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.wordpress.android.networking

import com.android.volley.DefaultRetryPolicy
import com.android.volley.Request
import com.android.volley.Request.Priority
import com.bumptech.glide.integration.volley.VolleyRequestFactory
Expand All @@ -12,6 +13,9 @@ import java.io.InputStream
import javax.inject.Inject
import javax.inject.Singleton

// Timeout in milliseconds for loading complex images at server side (private, heavy...)
private const val TIMEOUT = 15_000

/**
* RequestFactory which adds authorization headers to all Glide requests and makes sure requests to WPcom endpoints
* use https.
Expand All @@ -27,7 +31,18 @@ class GlideRequestFactory @Inject constructor(
headers: Map<String, String>
): Request<ByteArray>? {
val httpsUrl: String = convertWPcomUrlToHttps(url)
return VolleyStreamFetcher.GlideRequest(httpsUrl, callback, priority, addAuthHeaders(url, headers))
return VolleyStreamFetcher.GlideRequest(
Copy link
Contributor

Choose a reason for hiding this comment

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

I put a breakpoint here and viewed the post, but this was never called for me (and the high-res image never loaded).

I tried deleting the app and reinstalling then trying again, but the issue persists (so I don't think it's something to do with caching).

What would you suggest?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's odd. They loaded for me after 4 and 6 secs 🤔

ReaderPhotoView image loaded successfully after 4349ms https://wpmobilep2.wordpress.com/wp-content/uploads/2025/09/frame-3.png?w=2400
ReaderPhotoView image loaded successfully after 6202ms https://wpmobilep2.wordpress.com/wp-content/uploads/2025/09/frame-4.png?w=2400

Copy link
Contributor Author

@adalpari adalpari Sep 26, 2025

Choose a reason for hiding this comment

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

I've added some debug logs. So, could you try it again and send me the trace back? Tag: "ReaderPhotoView"

Copy link
Contributor

Choose a reason for hiding this comment

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

These aren't getting called either, so I did some searching. reader photo fragment > newInstance is getting called, so I added similar logs to the top of all the lifecycle methods in that fragment, and it seems none of them are being called?

This is a rather old test device – could that be related?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Odd... What Android version are you running?
Maybe there's an exception to run a different flow for old versions

httpsUrl,
callback,
priority,
addAuthHeaders(url, headers)
).apply {
retryPolicy = DefaultRetryPolicy(
TIMEOUT,
DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT
)
}
}

private fun convertWPcomUrlToHttps(url: String): String {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ private void loadImage() {
}

showProgress();

mImageManager
.loadWithResultListener(mImageView, ImageType.IMAGE, mHiResImageUrl, ScaleType.CENTER, mLoResImageUrl,
new RequestListener<Drawable>() {
Expand Down