{"action":"closed","issue":{"url":"https://api.github.com/repos/Azure/azure-documentdb-node/issues/146","repository_url":"https://api.github.com/repos/Azure/azure-documentdb-node","labels_url":"https://api.github.com/repos/Azure/azure-documentdb-node/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-documentdb-node/issues/146/comments","events_url":"https://api.github.com/repos/Azure/azure-documentdb-node/issues/146/events","html_url":"https://github.com/Azure/azure-documentdb-node/issues/146","id":181100073,"number":146,"title":"Headers no longer available in 1.10.0","user":{"login":"markusahlstrand","id":89469,"avatar_url":"https://avatars.githubusercontent.com/u/89469?v=3","gravatar_id":"","url":"https://api.github.com/users/markusahlstrand","html_url":"https://github.com/markusahlstrand","followers_url":"https://api.github.com/users/markusahlstrand/followers","following_url":"https://api.github.com/users/markusahlstrand/following{/other_user}","gists_url":"https://api.github.com/users/markusahlstrand/gists{/gist_id}","starred_url":"https://api.github.com/users/markusahlstrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markusahlstrand/subscriptions","organizations_url":"https://api.github.com/users/markusahlstrand/orgs","repos_url":"https://api.github.com/users/markusahlstrand/repos","events_url":"https://api.github.com/users/markusahlstrand/events{/privacy}","received_events_url":"https://api.github.com/users/markusahlstrand/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-10-05T09:04:50Z","updated_at":"2016-11-08T01:26:22Z","closed_at":"2016-11-08T01:26:22Z","body":"I just upgraded from 1.8.0 to 1.10.0 and the headers are no longer returned in this query:\n`client.queryDocuments(collectionLink, querySpec, options).toArray((err, items, headers) => {`\n\nI had a look in the code and don't understand the logic completely, but it seems to recursively iterate over the results and overwrite the headers in the second recursion:\nhttps://github.com/Azure/azure-documentdb-node/blob/master/source/lib/queryIterator.js#L144\n\nAdded a quick patch to validate that headers are defined which solved the issue, but I don't think this is the ideal solution. Is there a reason to recurse over the results? Is it that the iteration may trigger additional server requests?\n"}}
{"actor":{"display_login":"moderakh"}}