{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/react/issues/12974","repository_url":"https://api.github.com/repos/facebook/react","labels_url":"https://api.github.com/repos/facebook/react/issues/12974/labels{/name}","comments_url":"https://api.github.com/repos/facebook/react/issues/12974/comments","events_url":"https://api.github.com/repos/facebook/react/issues/12974/events","html_url":"https://github.com/facebook/react/pull/12974","id":328870396,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMjcyNjI3","number":12974,"title":"Failing test for Context bug in ReactPartialRenderer","user":{"login":"aweary","id":6886061,"node_id":"MDQ6VXNlcjY4ODYwNjE=","avatar_url":"https://avatars2.githubusercontent.com/u/6886061?v=4","gravatar_id":"","url":"https://api.github.com/users/aweary","html_url":"https://github.com/aweary","followers_url":"https://api.github.com/users/aweary/followers","following_url":"https://api.github.com/users/aweary/following{/other_user}","gists_url":"https://api.github.com/users/aweary/gists{/gist_id}","starred_url":"https://api.github.com/users/aweary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aweary/subscriptions","organizations_url":"https://api.github.com/users/aweary/orgs","repos_url":"https://api.github.com/users/aweary/repos","events_url":"https://api.github.com/users/aweary/events{/privacy}","received_events_url":"https://api.github.com/users/aweary/received_events","type":"User","site_admin":false},"labels":[{"id":196858374,"node_id":"MDU6TGFiZWwxOTY4NTgzNzQ=","url":"https://api.github.com/repos/facebook/react/labels/CLA%20Signed","name":"CLA Signed","color":"e7e7e7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-03T23:04:12Z","updated_at":"2018-06-05T23:42:21Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/facebook/react/pulls/12974","html_url":"https://github.com/facebook/react/pull/12974","diff_url":"https://github.com/facebook/react/pull/12974.diff","patch_url":"https://github.com/facebook/react/pull/12974.patch"},"body":"A failing test for the bug reported in https://github.com/facebook/react/issues/12968\r\n\r\nA summary of the issue is that rendering this combination of consumers and providers for multiple contexts causes a bug where the value from one context is being used in the other in subsequent renders.\r\n\r\nThis is possible because context is stored on the Context element itself, so it's mutated as the components are rendered. In this case, the wrong value is being set on a provider when its being popped:\r\n\r\nhttps://github.com/facebook/react/blob/36546b5137e9012ebdc62fc9ec11e3518c9e0aab/packages/react-dom/src/server/ReactPartialRenderer.js#L692-L700\r\n\r\n`previousProvider` ends up being the provider for the other context, so the next time it renders it has the wrong value. The assumption that the context type is correct because of the index check isn't accurate. It's also strange that it's always setting the context value to `previousProvider.props.value`, even if the provider doesn't have a value.\r\n\r\nNot sure what the right fix is, but I'd like to figure it out 😄 \r\n\r\ncc @acdlite @gaearon \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/facebook/react/issues/comments/394894766","html_url":"https://github.com/facebook/react/pull/12974#issuecomment-394894766","issue_url":"https://api.github.com/repos/facebook/react/issues/12974","id":394894766,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDg5NDc2Ng==","user":{"login":"aweary","id":6886061,"node_id":"MDQ6VXNlcjY4ODYwNjE=","avatar_url":"https://avatars2.githubusercontent.com/u/6886061?v=4","gravatar_id":"","url":"https://api.github.com/users/aweary","html_url":"https://github.com/aweary","followers_url":"https://api.github.com/users/aweary/followers","following_url":"https://api.github.com/users/aweary/following{/other_user}","gists_url":"https://api.github.com/users/aweary/gists{/gist_id}","starred_url":"https://api.github.com/users/aweary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aweary/subscriptions","organizations_url":"https://api.github.com/users/aweary/orgs","repos_url":"https://api.github.com/users/aweary/repos","events_url":"https://api.github.com/users/aweary/events{/privacy}","received_events_url":"https://api.github.com/users/aweary/received_events","type":"User","site_admin":false},"created_at":"2018-06-05T23:42:21Z","updated_at":"2018-06-05T23:42:21Z","author_association":"MEMBER","body":"@gaearon sure, but it sets `_currentValue` not `_defaultValue`\r\n\r\nhttps://github.com/facebook/react/blob/36546b5137e9012ebdc62fc9ec11e3518c9e0aab/packages/react-dom/src/server/ReactPartialRenderer.js#L699\r\n\r\nThe only place I see `_defaultValue` being used is when the provider stack is empty\r\n\r\nhttps://github.com/facebook/react/blob/36546b5137e9012ebdc62fc9ec11e3518c9e0aab/packages/react-dom/src/server/ReactPartialRenderer.js#L692-L694\r\n\r\nSo I'm not sure how setting it to `undefined` is doing anything\r\n\r\n"}}
{"actor":{"display_login":"aweary"}}