Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby): Add touchNode to populate typeOwners (#15918) #15919

Merged
merged 1 commit into from Jul 23, 2019

Conversation

@datakurre
Copy link
Contributor

commented Jul 19, 2019

Description

Gatsby keeps track of different node types by different source plugins and allows source plugins to only manage nodes of types they own. Unfortunately typeOwners mapping is only populated when nodes are being created (by createNode API). If nodes of certain type have only been touched so far (with touchNode), no source plugin owns that node type. This prevents the real owner of that node type from deleting cached nodes until it has created at least a single node of that type.

This seems to be the minimal change to make touchNode populate typeOwners mapping, but I don't know if that's the correct one.

Related Issues

#15918

@datakurre datakurre requested a review from gatsbyjs/core as a code owner Jul 19, 2019

@pieh pieh self-assigned this Jul 23, 2019

@pieh

This comment has been minimized.

Copy link
Contributor

commented Jul 23, 2019

I see 2 potential alternatives to achieve same thing:

  1. Persist typeOwners together with nodes in redux state
  2. Re-concstuct typeOwners when loading cached redux state.

But this is also correct, so let's merge this.

@pieh

pieh approved these changes Jul 23, 2019

Copy link
Contributor

left a comment

Thanks!

@pieh pieh merged commit 9d5026f into gatsbyjs:master Jul 23, 2019

18 checks passed

Danger All good
Details
Peril All green. Good on 'ya.
Details
ci/circleci: bootstrap Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_development_runtime Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_gatsby-image Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_path-prefix Your tests passed on CircleCI!
Details
ci/circleci: e2e_tests_production_runtime Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_gatsby_pipeline Your tests passed on CircleCI!
Details
ci/circleci: integration_tests_long_term_caching Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: starters_validate Your tests passed on CircleCI!
Details
ci/circleci: themes_e2e_tests_development_runtime Your tests passed on CircleCI!
Details
ci/circleci: themes_e2e_tests_production_runtime Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_node10 Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_node12 Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_node8 Your tests passed on CircleCI!
Details
ci/circleci: unit_tests_www Your tests passed on CircleCI!
Details
unit_tests_windows Build #20190723.22 succeeded
Details
@pieh

This comment has been minimized.

Copy link
Contributor

commented Jul 23, 2019

Published gatsby@2.13.34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.