{"action":"opened","issue":{"url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/814","repository_url":"https://api.github.com/repos/firebase/firebase-ios-sdk","labels_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/814/labels{/name}","comments_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/814/comments","events_url":"https://api.github.com/repos/firebase/firebase-ios-sdk/issues/814/events","html_url":"https://github.com/firebase/firebase-ios-sdk/issues/814","id":298358599,"number":814,"title":"Query limited to last 100 always return exactly 3 elements","user":{"login":"maximkhatskevich","id":2624646,"avatar_url":"https://avatars1.githubusercontent.com/u/2624646?v=4","gravatar_id":"","url":"https://api.github.com/users/maximkhatskevich","html_url":"https://github.com/maximkhatskevich","followers_url":"https://api.github.com/users/maximkhatskevich/followers","following_url":"https://api.github.com/users/maximkhatskevich/following{/other_user}","gists_url":"https://api.github.com/users/maximkhatskevich/gists{/gist_id}","starred_url":"https://api.github.com/users/maximkhatskevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maximkhatskevich/subscriptions","organizations_url":"https://api.github.com/users/maximkhatskevich/orgs","repos_url":"https://api.github.com/users/maximkhatskevich/repos","events_url":"https://api.github.com/users/maximkhatskevich/events{/privacy}","received_events_url":"https://api.github.com/users/maximkhatskevich/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-19T17:50:17Z","updated_at":"2018-02-19T17:50:17Z","closed_at":null,"author_association":"NONE","body":"ENVIRONMENT\r\n\r\n  * Xcode version: 9.2 (stable)\r\n  * Firebase SDK version: 4.6.0\r\n  * Firebase Component: Database\r\n  * Component version: 4.1.1\r\n\r\nWHAT I DO\r\n\r\nSetting up a Realtime Databse query on a collection of objects, order by child path and limit to last 100 elements. Then setup event observers for add, move, remove, change. I'm sure I have 5 elements in the collection total, they all satisfy to this query. \r\n\r\nWHAT I EXPECT\r\n\r\nGet all the 5 elements that I have in this collection in result set (the \"add\" event should be triggered 5 times).\r\n\r\nWHAT I GET\r\n\r\nOnly get exactly 3 elements in result set (the \"add\" event is being triggered 3 times).\r\n\r\nOTHER THINGS TO NOTE\r\n\r\nQuery works fine (as expected when limit is ANY number except \"100\", including 99 and 101.\r\n\r\nCODE SAMPLE\r\n\r\n```swift\r\nimport Firebase\r\n\r\nlet query = Database\r\n    .database()\r\n    .reference()\r\n    .child(\"publications\")\r\n    .queryOrdered(byChildPath: \"createdAt\") // Date\r\n    .queryLimited(toLast: 100)\r\n\r\nquery.observe(.childAdded)\r\n{\r\n    // display child in the app...\r\n}\r\n\r\n// here subscribe for other events in similar way...\r\n\r\n```"}}
{"actor":{"display_login":"maximkhatskevich"}}