You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
IOS: Offline pack is not working properly on next day when iPad is in offline. #9705
Leave the device offline until tomorrow, or change the date time in device to tomorrow.
Then the offline pack is not loading properly.
Expected behavior
The offline pack's should work even after the device is in offline for more than 3 to 4 days.
Actual behavior
But it's not working every time we need to come online.
We have client's who will work only in offline for more than 2 days. In that case the offline packs should work , but it's not working. I think the tiles are expiring every day.
I think we fixed the bulk of this problem with a simple change, in src/mbgl/tile/tile_loader_impl.hpp
template <typename T>
void TileLoader<T>::loadedData(const Response& res) {
if (res.error && res.error->reason != Response::Error::Reason::NotFound) {
- tile.setError(std::make_exception_ptr(std::runtime_error(res.error->message)));
+ if (!(tile.isComplete() && tile.isRenderable())) {
+ tile.setError(std::make_exception_ptr(std::runtime_error(res.error->message)));
+ }
} else if (res.notModified) {
resource.priorExpires = res.expires;
// Do not notify the tile; when we get this message, it already has the current
ThiyagarajanShivSankaran commented on Aug 21, 2017
@ThiyagarajanShivSankaran There’s been no change in the status of this issue — when someone has the opportunity to investigate further, they will post an update here. In the meantime, any additional information (or testing of proposed fixes) is much appreciated.
Open the device in airplane mode --> open the app again and the tiles are no longer showing
So i opened up the cache.db sqlite database and found out that the table: tiles has a column called expires and the value of the expires column has a date 12 hours After the offline pack was installed.
Is there a way to increase this time? (like at least by a year or something?)
We're treating a 404 response/not found as a valid response meaning "there is no data here" instead of using a correct HTTP 204 No content response. E.g. here:
When we have a tile successfully parsed/loaded (e.g. an expired tile from cache), subsequent attempts to refresh the tile fail, and overwrite the existing successfully parsed tile with empty data (this is what IOS: Offline pack is not working properly on next day when iPad is in offline. #9705 (comment) attempts to fix, although this fix doesn't work in situations where we're still parsing data (so the tile isn't renderable yet), then receive a revalidation error)
Activity
ThiyagarajanShivSankaran commentedon Aug 8, 2017
Please download the video file from dropbox for further reference of this issue,
https://www.dropbox.com/s/sdfs2y05ivrz9q3/mapbox%20offline%20pack%20issue.mov?dl=0
But, I have checked the same scenario using the older SDK v3.5.4, it's working there.
kkaefer commentedon Aug 10, 2017
@ThiyagarajanShivSankaran thanks for reporting this bug
kkaefer commentedon Aug 10, 2017
@ThiyagarajanShivSankaran it's hard to see this from the video; are you using raster tiles or vector tiles?
ThiyagarajanShivSankaran commentedon Aug 10, 2017
@kkaefer we are using vector tiles. Sorry for the video clarity can you download and check. Thanks.
arnekaiser commentedon Aug 10, 2017
This looks like #9211
I think the expires timestamps in the database are expired after some days.
andrewljohnson commentedon Aug 17, 2017
I think we fixed the bulk of this problem with a simple change, in src/mbgl/tile/tile_loader_impl.hpp
ThiyagarajanShivSankaran commentedon Aug 21, 2017
Can I know what is the status of this issue. We need this to be fixed immediately. Thanks.
ThiyagarajanShivSankaran commentedon Aug 29, 2017
@kkaefer @friedbunny @boundsj Status please ???
friedbunny commentedon Aug 30, 2017
@ThiyagarajanShivSankaran There’s been no change in the status of this issue — when someone has the opportunity to investigate further, they will post an update here. In the meantime, any additional information (or testing of proposed fixes) is much appreciated.
arethasamuel commentedon Sep 1, 2017
@andrewljohnson is this fix in the latest release of mapbox sdk? 3.6.2? we will test this and get back to you
andrewljohnson commentedon Sep 1, 2017
@arethasamuel not AFAIK
arethasamuel commentedon Sep 1, 2017
@andrewljohnson @kkaefer @friedbunny @boundsj
this issue still exists in mapbox 3.6.2
So i opened up the cache.db sqlite database and found out that the table: tiles has a column called expires and the value of the expires column has a date 12 hours After the offline pack was installed.
Is there a way to increase this time? (like at least by a year or something?)
ThiyagarajanShivSankaran commentedon Sep 5, 2017
Hi @friedbunny yeah the above fix is working.
jmkiley commentedon Sep 12, 2017
@kkaefer do you think that the fix @andrewljohnson proposed in #9705 (comment) should be pulled into the SDK?
kkaefer commentedon Sep 13, 2017
There are several underlying issues:
mapbox-gl-native/platform/default/http_file_source.cpp
Line 378 in 366a697
I attempted a refactor of our tile state system in https://github.com/mapbox/mapbox-gl-native/tree/make-stale-resources-renderable, but it's incomplete.
friedbunny commentedon Sep 25, 2017
This should be fixed by #10012 and 3.6.4, which will be available imminently.