Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Out of bounds interaction telemetry events on Android #4444

Closed

Description

@camilleanne

Seeing some Android interaction events (map.click) come in that have out of bounds values for lng -- in api-events we strictly enforce lat to between -90 and 90, and lng to -180 to 180 so these events are getting filtered out.

e.g.

lat: 39.130515262056804, lng: -187.88018805382615

lat: -64.25024633537475, lng: 191.59464321880097

cc @bleege

Activity

  1. added
    Android
    telemetry
    on Mar 23, 2016
  2. added this to the android-v4.0.0 milestone on Mar 23, 2016
  3. self-assigned this
    on Mar 23, 2016
  4. bleege commented on Mar 24, 2016

    @bleege
    Contributor

    I've been able to reproduce the issue for Longitude. It seems centered around the International Date Line. I'll continue looking to see if I can find it elsewhere.

    03-24 15:08:28.594 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 503.0, y = 765.52454; tapLatLng = LatLng [longitude=-170.73755048183057, latitude=20.631945963786507, altitude=0.0]
    03-24 15:08:28.624 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 510.02267, y = 764.4962; tapLatLng = LatLng [longitude=-170.54494119212745, latitude=20.65833841256945, altitude=0.0]
    03-24 15:08:28.634 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 513.0, y = 764.0; tapLatLng = LatLng [longitude=-170.46328199459674, latitude=20.67107244593123, altitude=0.0]
    03-24 15:08:28.634 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 513.0, y = 764.0; tapLatLng = LatLng [longitude=-170.46328199459674, latitude=20.67107244593123, altitude=0.0]
    03-24 15:08:34.514 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 531.0, y = 794.0; tapLatLng = LatLng [longitude=-175.15328030718524, latitude=20.438555684695217, altitude=0.0]
    03-24 15:08:39.494 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 376.0, y = 844.0; tapLatLng = LatLng [longitude=-180.48651391197888, latitude=19.76890837502343, altitude=0.0]
    03-24 15:08:47.634 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 293.0, y = 860.0; tapLatLng = LatLng [longitude=176.30453970395126, latitude=19.48032017375806, altitude=0.0]
    03-24 15:08:49.574 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 409.0, y = 849.0; tapLatLng = LatLng [longitude=177.8952992525888, latitude=19.622469995904936, altitude=0.0]
    03-24 15:08:50.944 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 460.0, y = 838.0; tapLatLng = LatLng [longitude=178.59468496221257, latitude=19.764494192798992, altitude=0.0]
    03-24 15:08:52.424 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 543.0, y = 809.0; tapLatLng = LatLng [longitude=179.7329011302631, latitude=20.138315647099105, altitude=0.0]
    03-24 15:08:54.024 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 610.0, y = 819.0; tapLatLng = LatLng [longitude=180.65170175522468, latitude=20.009511668446294, altitude=0.0]
    03-24 15:08:56.314 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 662.0, y = 803.0; tapLatLng = LatLng [longitude=181.3648013286366, latitude=20.215546908862876, altitude=0.0]
    03-24 15:08:59.514 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 662.0, y = 791.0; tapLatLng = LatLng [longitude=181.3648013286366, latitude=20.36989436476091, altitude=0.0]
    03-24 15:09:04.884 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 646.0, y = 801.0; tapLatLng = LatLng [longitude=-177.07237023360594, latitude=20.13831525485371, altitude=0.0]
    03-24 15:09:11.384 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 509.5, y = 840.0; tapLatLng = LatLng [longitude=-178.94425551524685, latitude=19.635386525623275, altitude=0.0]
    03-24 15:09:11.404 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 509.5, y = 840.0; tapLatLng = LatLng [longitude=-178.94425551524685, latitude=19.635386525623275, altitude=0.0]
    03-24 15:09:11.414 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 885.0, y = 810.0; tapLatLng = LatLng [longitude=-173.7948566008229, latitude=20.02239678589983, altitude=0.0]
    03-24 15:09:11.424 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 508.0, y = 839.0; tapLatLng = LatLng [longitude=-178.96482568317697, latitude=19.64830240999642, altitude=0.0]
    03-24 15:09:11.424 14948-14948/com.mapbox.mapboxsdk.testapp I/ScaleGestureDetector: TwScaleGestureDetector
    03-24 15:09:12.384 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 886.0, y = 810.0; tapLatLng = LatLng [longitude=-164.81730106297266, latitude=21.333094041341667, altitude=0.0]
    03-24 15:09:12.844 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 544.0, y = 858.5; tapLatLng = LatLng [longitude=-177.9143768488237, latitude=19.732811237540616, altitude=0.0]
    03-24 15:09:12.854 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 544.0, y = 858.5; tapLatLng = LatLng [longitude=-177.9143768488237, latitude=19.732811237540616, altitude=0.0]
    03-24 15:09:12.864 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 869.0, y = 849.0; tapLatLng = LatLng [longitude=-164.59684496399072, latitude=20.09880967753537, altitude=0.0]
    03-24 15:09:12.864 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 543.1528, y = 858.5; tapLatLng = LatLng [longitude=-177.9490937712945, latitude=19.732811237540616, altitude=0.0]
    03-24 15:09:12.874 14948-14948/com.mapbox.mapboxsdk.testapp I/ScaleGestureDetector: TwScaleGestureDetector
  5. bleege commented on Mar 24, 2016

    @bleege
    Contributor

    Was also able to verify this when zoomed out to Zoom 0 and trying to tap the North and South Poles for Latitude range testing around the International Date Line.

    03-24 15:14:11.424 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 351.0, y = 1314.0; tapLatLng = LatLng [longitude=131.04411122034674, latitude=-70.88488827714265, altitude=0.0]
    03-24 15:14:12.844 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 627.0, y = 64.0; tapLatLng = LatLng [longitude=188.78114551104846, latitude=83.71261182839297, altitude=0.0]
    03-24 15:14:14.984 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 644.0, y = 125.0; tapLatLng = LatLng [longitude=197.15329713231466, latitude=82.10275364917152, altitude=0.0]
    03-24 15:14:15.874 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 614.0, y = 28.0; tapLatLng = LatLng [longitude=191.23104134769966, latitude=84.50465429121468, altitude=0.0]
    03-24 15:14:28.154 14948-14948/com.mapbox.mapboxsdk.testapp I/MapView: x = 627.0, y = 1607.0; tapLatLng = LatLng [longitude=194.0217541963687, latitude=-83.5699672169096, altitude=0.0]
  6. 1ec5 commented on Mar 24, 2016

    @1ec5
    Contributor

    This regression is due to cutting the release branch after #4275 landed but before #4285 landed. If #4285 remains too risky, we can wrap the coordinates at the SDK/JNI level for each platform as a stopgap.

    /cc @jfirebaugh

  7. bleege commented on Mar 24, 2016

    @bleege
    Contributor

    Also noting that this is going to be an issue on the iOS side too.

    /cc @boundsj

  8. added
    iOS
    on Mar 24, 2016
  9. 1ec5 commented on Mar 24, 2016

    @1ec5
    Contributor

    #4464 mitigates the issue on iOS.

  10. added a commit that references this issue on Mar 24, 2016
  11. bleege commented on Mar 24, 2016

    @bleege
    Contributor

    After consulting with @1ec5 @jfirebaugh @brunoabinader and reviewing Google's Android LatLng API I decided that it was safe to wrap at the JNI level for all use cases of nativeLatLngForPixel() as LatLng in the Google API is always wrapped for both Latitude and Longitude. The timing is also right as this is a major semver bump to 4.0.0 so if there was a time to try a change like this it's now.

    screen shot 2016-03-24 at 5 01 53 pm
    Google's Android LatLng API

    For future archeological digs though, at this time the only place that uses nativeLatLngForPixel() is in MapView.fromScreenLocation() which is used primarily for Telemetry and Gesture handling. It is used once in Projection.fromScreenLocation().

    screen shot 2016-03-24 at 4 10 01 pm
    MapView.fromScreenLocation()

    screen shot 2016-03-24 at 4 10 39 pm
    Uses of MapView.fromScreenLocation() In SDK

  12. bleege commented on Mar 24, 2016

    @bleege
    Contributor

    Merged into release-ios-3.2.0-android-4.0.0 and will rely on merge of this branch back into master to bring this functionality forward.

  13. bleege commented on Mar 24, 2016

    @bleege
    Contributor

    I just used the TestApp pointed against Production to send in a bunch of map.click events and according the logs it happily accepted them! 😄

    03-24 17:22:53.314 11848-14870/com.mapbox.mapboxsdk.testapp I/MapboxEventManager: response code = 204 for events 72
  14. 1ec5 commented on Mar 24, 2016

    @1ec5
    Contributor

    The timing is also right as this is a major semver bump to 4.0.0 so if there was a time to try a change like this it's now.

    To clarify, #4464 and #4465 prevent a change in behavior as compared to the previous releases. If you ever remove the wrapping, as @jfirebaugh has proposed, we’ll need another semver bump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

AndroidbugiOStelemetry

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions