-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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-source-contentful): fixed id collision in contentful entries #23514
fix(gatsby-source-contentful): fixed id collision in contentful entries #23514
Conversation
If anyone has any ideas as to why those unit tests fail that'd be helpful thanks. Nothing appears to be wrong in the tests, and the actual code functions correctly. |
Failures do seem unrelated. Maybe try merging master to this branch? |
08a28a5
to
3995cd0
Compare
Seems it still fails, with an unrelated linting issue now too |
If you enable us to commit to the branch we could try to run our formatter. Currently you have to do it manually by running |
3995cd0
to
e80d55a
Compare
The checkbox to allow committing to the branch is missing so I can't enable it sorry - I could move this to a branch on the official Gatsby project if that'd make it easier. I've just made some changes that fix the test issues within this PR, and also just fix ones that are in master so that it passes |
packages/gatsby-source-contentful/src/__tests__/__snapshots__/gatsby-node.js.snap
Show resolved
Hide resolved
00ab480
to
81a1957
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job and thanks for the PR!
I've added a couple of comments inline. Also, I think we need tests for this use case because there are certainly edge cases (sys.linkType
vs sys.type
; deleted entries; also I see foreignReferenceMap
uses sys.id
as a key which can possibly break with identical ids but different types).
81a1957
to
4a9b0d9
Compare
I've just fixed the issues noted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, Thanks!
But I need to test it locally before merging. So it will take some time as I am busy with something else at the moment.
Also, it would be great to add some tests for this use-case (identical ids in different types)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to be rebased on #15084
@axe312ger Should we wait for #15084 to get this in? I feel this one is an easier merge than #15084 |
I think both PRs are potentially breaking so it might make sense to include them both in a new major version of the plugin? What do you think? |
@vladar yes! Totally down for this! |
…es (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (gatsbyjs#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (gatsbyjs#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (gatsbyjs#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…es (gatsbyjs#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries
…e performance (#27244) * fix(gatsby-source-contentful): fixed id collision in contentful entries (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries * fix(gatsby-source-contentful): properly resolve subsequent sync calls (#15084) * fix(gatsby-source-contentful): fixed id collision in contentful entries (#23514) * fix(gatsby-source-contentful): fixed id collision in contentful entries * improve logging and clean up code (#26238) * improve comment about contentful-resolve-response usage * test(unit): remove cross test data pollution * further improve loggin by replacing console.time with GatsbyReporter * improve code style * missing file * remove logging verbosity * adjust mocked reporter for tests to pass * remove unused deep-map dependency * fix: use content type id by default to create reference gql types (#26102) * temporary console.time calls for performance measurements * perf(gatsby-source-contentful): use a map and less loops to merge old and latest sync API response * log time Contentful API processing and GraphQL node creation * upgrade dependencies and use faster node 10 versions * remove duplicate logging * allow multiple Contentful sources fixes #26875 * refactor(imports): fix dependency structure and make sharp optional fixes #23904 * align tests to match new multi source cache pattern Co-authored-by: Matthew Miller <mnmiller1@me.com> Co-authored-by: Khaled Garbaya <khaled@contentful.com>
Description
This resolves an ID collision in the contentful source plugin, as noted here: #22004 (comment)
Related Issues
Related to #22004