To reproduce:
Start an offline pack download, while download kill the app
Start app back up and getPacks(), loop through each pack and call pack.status()
My response looks like:
{
"completedResourceCount": 0,
"completedTileCount": 0,
"name": "Aaa",
"requiredResourceCount": 0,
"completedTileSize": 0,
"completedResourceSize": 0,
"percentage": 0,
"state": 0
}
It seems to me that it should be in a status of 1 (Inactive) to allow pack.resume() to be called
EDIT: This was found on iOS. Android seemed to auto-resume, but it would be wise to get a second-test on this as my emulator isn't in the bast shape at the moment.
Side note that I just found: Percentage field in the object above is not rounded on Android, resulting in a percent looking like: 20.009220839096358 while iOS is rounded.
I'm fine with running a Math.floor or Math.ceil myself, I just think the two platforms should behave consistently.
I'm wondering where the fix for this should live. If the Android Maps SDK is handling the auto resume itself, then I think the iOS SDK should handle the auto resume itself. I'll have to timebox this to see what level of the stack this is happening on
I’m not so sure it should be at the SDK level. I know that v5 had RN code that would resume packs on launch. Maybe we’re missing similar code?
Regardless, the status was definitely wrong. I’ll try again soon.
On Feb 13, 2018, at 3:00 PM, Nick Italiano notifications@github.com wrote:
I'm wondering where the fix for this should live. If the Android Maps SDK is handling the auto resume itself, then I think the iOS SDK should handle the auto resume itself. I'll have to timebox this to see what level of the stack this is happening on
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
To avoid this issue I am triggering resume before calling status.
await pack.resume();
const status = await pack.status()
However I wonder if you have any other solution to this issue on iOS.
Is this still an issue?
Yes, it is.
Confirming this issue and workaround of @RobertSasak.
I'll figure out if this is a native side thing or something with the RN wrapper.
any updates? I have reproduced the problem, but without killing the app while downloading packs. Just wait for the completion handler (callback) then reload the app. And all my packs are with state 0
Most helpful comment
Confirming this issue and workaround of @RobertSasak.
I'll figure out if this is a native side thing or something with the RN wrapper.