-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix: CMM-754 bug when loading big images in high res #22235
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
base: trunk
Are you sure you want to change the base?
Changes from all commits
1d7d320
4bbb2f9
189cfcd
afeb205
cf34d08
2695ef6
8fa0a12
c8186ce
e58859a
5c3e83e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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 | ||
|
@@ -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. | ||
|
@@ -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( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's odd. They loaded for me after 4 and 6 secs 🤔
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These aren't getting called either, so I did some searching. This is a rather old test device – could that be related? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Odd... What Android version are you running? |
||
httpsUrl, | ||
callback, | ||
priority, | ||
addAuthHeaders(url, headers) | ||
).apply { | ||
retryPolicy = DefaultRetryPolicy( | ||
TIMEOUT, | ||
DefaultRetryPolicy.DEFAULT_MAX_RETRIES, | ||
DefaultRetryPolicy.DEFAULT_BACKOFF_MULT | ||
) | ||
} | ||
} | ||
|
||
private fun convertWPcomUrlToHttps(url: String): String { | ||
|
Uh oh!
There was an error while loading. Please reload this page.