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

Đang mở
#2,461 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
28/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
swift
Lĩnh vực
mobile

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
Swift
Star
601
Fork
198
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của mapbox/mapbox-maps-ios

Tất cả issue của mapbox/mapbox-maps-ios

Issue tương tự

Thêm issue về Swift

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.