{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/14157","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/14157/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/14157/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/14157/events","html_url":"https://github.com/Automattic/wp-calypso/pull/14157","id":229310670,"number":14157,"title":"Data Layer: Save response headers in the action `meta` when redispatching","user":{"login":"bperson","id":1145270,"avatar_url":"https://avatars3.githubusercontent.com/u/1145270?v=3","gravatar_id":"","url":"https://api.github.com/users/bperson","html_url":"https://github.com/bperson","followers_url":"https://api.github.com/users/bperson/followers","following_url":"https://api.github.com/users/bperson/following{/other_user}","gists_url":"https://api.github.com/users/bperson/gists{/gist_id}","starred_url":"https://api.github.com/users/bperson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bperson/subscriptions","organizations_url":"https://api.github.com/users/bperson/orgs","repos_url":"https://api.github.com/users/bperson/repos","events_url":"https://api.github.com/users/bperson/events{/privacy}","received_events_url":"https://api.github.com/users/bperson/received_events","type":"User","site_admin":false},"labels":[{"id":301697869,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/OSS%20Citizen","name":"OSS Citizen","color":"5319e7","default":false},{"id":542899089,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Size]%20M","name":"[Size] M","color":"8d478a","default":false},{"id":285010018,"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-05-17T10:44:26Z","updated_at":"2017-05-24T16:15:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/14157","html_url":"https://github.com/Automattic/wp-calypso/pull/14157","diff_url":"https://github.com/Automattic/wp-calypso/pull/14157.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/14157.patch"},"body":"This is an attempt at giving easy access - in the data layer - to response headers, now available through [wpcom.js 5.4.0](https://github.com/Automattic/wpcom.js/pull/213).\r\n\r\nThe main use case right now is to access the [REST API pagination headers](https://developer.wordpress.org/rest-api/using-the-rest-api/pagination/): `X-WP-Total` and `X-WP-TotalPages`.\r\n\r\nI didn't update `dispatchRequest` success / error handlers signatures with a last parameter containing the `headers` to limit as much as possible the impact of this change. Essentially, all it does is add another key in the action's `meta.dataLayer` object. In the success / error handlers, we can use the util function `getHeaders` to extract them from the action as demonstrated in the updated #13828.\r\n\r\nThis is the last PR to unblock #13828.\r\n\r\nIn the shrinkmap, nothing really worrisome:\r\n- time-stamp has gotten a minor refactor but [nothing big](https://github.com/jonschlinkert/time-stamp/commit/14b0ed1c7d1723ade46d33266cc361359ef05443)\r\n- node-abi changed a few supported targets\r\n- es5-ext gets a couple of new shims: `safeToString`, `ensurePromise` and `isPromise`."},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/303774386","html_url":"https://github.com/Automattic/wp-calypso/pull/14157#issuecomment-303774386","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/14157","id":303774386,"user":{"login":"hoverduck","id":7233112,"avatar_url":"https://avatars1.githubusercontent.com/u/7233112?v=3","gravatar_id":"","url":"https://api.github.com/users/hoverduck","html_url":"https://github.com/hoverduck","followers_url":"https://api.github.com/users/hoverduck/followers","following_url":"https://api.github.com/users/hoverduck/following{/other_user}","gists_url":"https://api.github.com/users/hoverduck/gists{/gist_id}","starred_url":"https://api.github.com/users/hoverduck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hoverduck/subscriptions","organizations_url":"https://api.github.com/users/hoverduck/orgs","repos_url":"https://api.github.com/users/hoverduck/repos","events_url":"https://api.github.com/users/hoverduck/events{/privacy}","received_events_url":"https://api.github.com/users/hoverduck/received_events","type":"User","site_admin":false},"created_at":"2017-05-24T16:15:40Z","updated_at":"2017-05-24T16:15:40Z","body":"The e2e test suite ran clean and green 💚  "}}
{"actor":{"display_login":"hoverduck"}}