Skip to content
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

Map view is blank after the app is in the background for a long time. #2123

Open
longdike1 opened this issue Feb 19, 2024 · 21 comments
Open
Labels
bug 🪲 Something is broken!

Comments

@longdike1
Copy link

longdike1 commented Feb 19, 2024

Environment

  • Xcode version: 15.1
  • iOS version: 17.2.1, 15.2
  • Devices affected: iPhone 13 promax, iPhone 7 plus
  • Maps SDK Version: 11.1.0

Observed behavior and steps to reproduce

  • Create an app with MapView, configure MBXAccessToken key in project's Info.plist with valid a access token
  • Open the app, the map is loaded successfully
  • Put the app in the background, lock the screen
  • After 1 or 2 days, reopen the app in the foreground, the map is blank
  • Put the app in the background and then reopen it, the map is still blank
  • Close the app, delete it from memory and then reopen it, the map is loaded successfully again

Expected behavior

  • The map should not be blank after the app is in the background for a long time.

Notes / preliminary analysis

Additional links and references

Map blank after the app in background:
map_blank

The issue also occurs with the Example App:
map_blank_ex

map_blank.SD.480p.mov
@longdike1 longdike1 added the bug 🪲 Something is broken! label Feb 19, 2024
@persidskiy
Copy link
Contributor

@longdike1 Hi, thank you for the report.

When the map turns black, do only the map tiles disappear, or does the content that you add onto the map disappear too? In the first screenshot, I see that you have a blue marker. Did you add it as an annotation or layer? Is it draggable when the map is black?

@longdike1
Copy link
Author

Hi @persidskiy, thanks for replying,

When the map turns black, only the map tiles disappear, the content that I add onto the map still appears. It is draggable when the map is black.
In the first screenshot, I added a marker as a PointAnnotation:

pointAnnotationManager = mapView.annotations.makePointAnnotationManager(id: "pointAnnotationId")
...
var pointAnnotation = PointAnnotation(id: annotationItem.id, coordinate: annotationItem.coordinates)
pointAnnotation.iconImage = annotationItem.image
pointAnnotation.iconAnchor = .bottom
pointAnnotationManager.annotations.append(pointAnnotation)

We previously used Mapbox-iOS-SDK v6.4.1 and did not see this issue. Please let me know if you need more information.

@evil159
Copy link
Contributor

evil159 commented Feb 20, 2024

@longdike1 Thank you for providing more details about this! Just want to confirm this - does this issue reproduce in debug mode(connected to debugger)?
Could you provide logs as well?

@evil159
Copy link
Contributor

evil159 commented Feb 20, 2024

I've created an internal ticket to track this issue https://mapbox.atlassian.net/browse/MAPSIOS-1326

@longdike1
Copy link
Author

longdike1 commented Feb 20, 2024

@longdike1 Thank you for providing more details about this! Just want to confirm this - does this issue reproduce in debug mode(connected to debugger)? Could you provide logs as well?

I haven't tried reproducing this issue in debug mode because it takes 1 or 2 days.
When the map is empty, I try connecting it to the debugger, the application restarts and the map works again

I have implemented onMapLoadingError observer but it doesn't print any log when the map is blank:

mapboxMap.onMapLoadingError.observe { event in
    Logger.log(message: "mapboxMap.onMapLoadingError: \(event.message)")
}.store(in: &cancelables)

@jimmya
Copy link

jimmya commented Mar 12, 2024

@evil159 any update on this one?

We're experiencing the same behaviour after upgrading to Mapbox 11.2.0, also using Xcode 15.1.

Before we were using 10.15.0 and everything was working perfectly fine.

@evil159
Copy link
Contributor

evil159 commented Mar 12, 2024

@jimmya At the moment we cannot reproduce the issue.

@evil159
Copy link
Contributor

evil159 commented Mar 12, 2024

We suspect tile store to be causing this, as a workaround you can disable tile store:

MapboxMapsOptions.tileStoreUsageMode = .disabled

It should not affect anything, unless you are using offline functionality.

@jimmya
Copy link

jimmya commented Mar 14, 2024

@evil159 this temporary fix indeed looks to resolve the issue for us.

Can you please let us know when the issue is fixed and released so we can remove this workaround?

Thanks!

@evil159
Copy link
Contributor

evil159 commented Mar 14, 2024

Sure thing @jimmya, we'll keep you posted.

@longdike1
Copy link
Author

We suspect tile store to be causing this, as a workaround you can disable tile store:

MapboxMapsOptions.tileStoreUsageMode = .disabled

It should not affect anything, unless you are using offline functionality.

Unfortunately we are using offline functionality..
Hopefully this issue will be fixed and released soon.

@ittna
Copy link

ittna commented Apr 8, 2024

Same here. Offline functionality is important to us. Any updates?

@brendanw
Copy link

We are also seeing this issue on mapbox 11.3.0 — hard to reproduce but the initial bug report is accurate: after prolonged app usage or leaving the app open for a day and then resuming

@ristiisa
Copy link

We are also experiencing the same issue with 11.3.0 in our testflight builds. The issue is also reproducible with the Snapshotter.

@evil159 any updates? Any ways we could help with collecting logs?

@ristiisa
Copy link

ristiisa commented May 28, 2024

Here is the full log of the testing period 2024-05-24T13:00:34Z .. 2024-05-28T08:14:11Z. There is something different at 2024-05-27T04:33:24Z. I checked the phone at 2024-05-27T06:48:00Z and the opened map was displaying tiles. I checked again around 2024-05-28T07:56:24Z and then no more tiles, just black.

mapbox-logs 2.txt

@iMark21
Copy link

iMark21 commented Jun 11, 2024

Same here, happening on iPad devices. Any updates?

@richardpineo
Copy link

+1 - we are seeing this in our production application as well. We utilize offline data so disabling that is not an option for us.

@Kingjames52-bot

This comment was marked as spam.

@ristiisa
Copy link

@evil159
@maios
@persidskiy

any updates?

@baleboy
Copy link

baleboy commented Aug 12, 2024

We have introduced some threading related changes in 11.5 that may help with this problem. It's hard for us to confirm because for whatever reason we are unable to reproduce the issue ourselves, if someone who can reproduce consistently could try with 11.5 (or later) and report back that would be extremely helpful, thank you!

@james-fresco
Copy link

james-fresco commented Sep 20, 2024

I can confirm this issue is still occurring in 11.5.

One note is it only occurs on tiles served from Mapbox - most notably satellite-raster and topography maps. The tiles from our in-house tile server are fine.

Also, if the user zooms all the way out, the tiles will eventually appear and they can use the map as normal again.
We use offline maps so we haven't tried the work-around.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something is broken!
Projects
None yet
Development

No branches or pull requests