{"action":"closed","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/12723","repository_url":"https://api.github.com/repos/mapbox/mapbox-gl-native","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/12723/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/12723/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/12723/events","html_url":"https://github.com/mapbox/mapbox-gl-native/issues/12723","id":353170261,"node_id":"MDU6SXNzdWUzNTMxNzAyNjE=","number":12723,"title":"Weird behavior when combining Predicates/Expressions","user":{"login":"MehdiSv","id":3958226,"node_id":"MDQ6VXNlcjM5NTgyMjY=","avatar_url":"https://avatars0.githubusercontent.com/u/3958226?v=4","gravatar_id":"","url":"https://api.github.com/users/MehdiSv","html_url":"https://github.com/MehdiSv","followers_url":"https://api.github.com/users/MehdiSv/followers","following_url":"https://api.github.com/users/MehdiSv/following{/other_user}","gists_url":"https://api.github.com/users/MehdiSv/gists{/gist_id}","starred_url":"https://api.github.com/users/MehdiSv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MehdiSv/subscriptions","organizations_url":"https://api.github.com/users/MehdiSv/orgs","repos_url":"https://api.github.com/users/MehdiSv/repos","events_url":"https://api.github.com/users/MehdiSv/events{/privacy}","received_events_url":"https://api.github.com/users/MehdiSv/received_events","type":"User","site_admin":false},"labels":[{"id":92400707,"node_id":"MDU6TGFiZWw5MjQwMDcwNw==","url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels/iOS","name":"iOS","color":"000000","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-23T00:08:41Z","updated_at":"2018-08-24T19:32:00Z","closed_at":"2018-08-24T19:32:00Z","author_association":"NONE","body":"**Platform: iOS\r\nMapbox SDK version: 4.2.0**\r\n\r\nI'm trying to apply a filter in addition to a layer's default filter.\r\nMy default filter is like this:\r\n\r\n```\r\nMGL_MATCH(name, {\"Free\", \"MeterHour\", \"NoData\", \"TimeLimit\"}, 1, 0) == 1)\r\n```\r\n\r\nMy additional filter looks like this:\r\n```\r\n(CAST(price, \"NSNumber\") <= 25 OR price == nil)\r\n```\r\n\r\nBoth filters combined look like this:\r\n```\r\n(CAST(price, \"NSNumber\") <= 25 OR price == nil) AND MGL_MATCH(name, {\"Free\", \"MeterHour\", \"NoData\", \"TimeLimit\"}, 1, 0) == 1\r\n```\r\nBut the price == nil is not taken into account.\r\n\r\nThis is how I create my additional filter:\r\n```\r\nlet priceValuePredicate = NSPredicate(format: \"CAST(price, 'NSNumber') <= \\(Int(value))\")\r\nlet priceNamePredicate = NSPredicate(format: \"price == nil\")\r\nreturn NSCompoundPredicate(type: .or, subpredicates: [priceValuePredicate, priceNamePredicate])\r\n\r\n```\r\n\r\nShould I create it differently for this to work?\r\nI'm not sure what is the issue here.\r\n\r\nNote: If I remove the default filter, everything works as expected (nil is taken into account)."}}
{"actor":{"display_login":"fabian-guerra"}}