Attribution sheet intermittently lists no attributions (Standard style, 11.26.0)

Abierto
#2,461 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
28/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
swift
Área
mobile

Línea de trabajo

Start from MapboxMap.loadAttributions and Attribution.parse(__map.getAttributions()); the failing path is that getAttributions() returns nothing after the Standard style loads, so trace where style and source attributions are registered. The report gives no minimal repro, so first reproduce the intermittent empty list in a small MapView harness and compare a failing launch against a passing one. Done means the sheet always lists the style attributions plus any source attribution.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

auto-triaged bug :beetle: p2

Environment

  • Xcode version: 27.2 (27B52)
  • iOS version: iOS 27.2 (Simulator); one physical iPhone
  • Devices affected: iOS Simulator (iPhone 17) and a physical iPhone
  • Maps SDK Version: MapboxMaps 11.26.0, MapboxCoreMaps 11.26.0, MapboxCommon 24.26.0

Observed behavior and steps to reproduce

Intermittently, the attribution (ⓘ) button's action sheet lists no attributions. The sheet titled "Powered by Mapbox Maps" shows only "Mapbox Telemetry", "Mapbox Privacy Policy" and "Cancel". The "© Mapbox", "© OpenStreetMap" and "Improve this map" entries are missing.

  • Style: Mapbox Standard (MapInitOptions(mapStyle: .standard(...))). The map is hosted in SwiftUI through a UIViewRepresentable.
  • How often: 2 of 6 app launches on the Simulator, and at least once on a device. The other launches list every attribution.
  • It sticks: once a MapView's list is empty, it stays empty for the life of that view. Reopening the sheet, waiting 5 s, or moving the camera doesn't bring it back.

We couldn't reduce it to a minimal project. What we measured in unit tests, reading the list the sheet uses (MapboxMap.loadAttributions via @testable import MapboxMaps) after the style had loaded:

Setup Empty lists
Bare MapView, same Standard options, nothing else 0 of 17
Same map, with our setup attached before the map loads 3 of 58
Same, without the four observers listed last below 1 of 52

"Our setup" subscribes, before load, to onCameraChanged, onRenderFrameFinished, onMapIdle, onStyleLoaded and onMapLoaded, and also to onSourceDataLoaded, onMapLoadingError, a second onMapIdle and a second onCameraChanged. In onMapLoaded it adds a raster-dem source (mapbox://mapbox.mapbox-terrain-dem-v1) with a hillshade layer and terrain, a vector source (mapbox://mapbox.mapbox-terrain-v2) for contour lines, GeoJSON sources with symbol and circle layers, and sometimes a raster source with its own attribution. Removing the onMapLoaded, onMapIdle or onRenderFrameFinished handler one at a time gave 0 of 12 each, which at this rate is too few runs to tell either way.

Expected behavior

The ⓘ sheet always lists the style's attributions: "© Mapbox", "© OpenStreetMap", "Improve this map", plus the attribution of any source on the map. The attribution guide names the ⓘ button as the way an iOS app shows the required attribution. When the list is empty, the app has no attribution on screen.

Notes / preliminary analysis

  • The sheet's list comes from MapboxMap.loadAttributions, which is Attribution.parse(__map.getAttributions()). In the failing cases that call returns nothing, even though the style has loaded. In the app the map itself renders normally.
  • Empty-or-full is decided once per map and doesn't change afterwards, which makes us suspect a race when the style's sources are first registered, not a problem in the sheet's UI.
  • As a workaround we're adding our own text attribution on the map, next to the logo.

Additional links and references

Lenguaje dominante
Swift
Estrellas
601
Forks
198
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de mapbox/mapbox-maps-ios

Todos los issues de mapbox/mapbox-maps-ios

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.