Skip to content
New issue

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

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

Already on GitHub? # to your account

chore(deps): match bson version with mongodb's bson version #15297

Merged
merged 1 commit into from
Mar 4, 2025

Conversation

hasezoey
Copy link
Collaborator

@hasezoey hasezoey commented Mar 4, 2025

Summary

This PR updates mongoose's bson dependency version to match mongodb's bson version.
Because package managers that upgrade might decide to stay on the old version for mongoose but use newer for mongodb (like yarn 1x), as i had encountered while updating typegoose.
Mismatched version can cause (runtime) type check failures, like:

    expect(received).toBeInstanceOf(expected)

    Expected constructor: ObjectId
    Received constructor: ObjectId

      422 |
      423 |   found.mapped.forEach((v) => {
    > 424 |     expect(v).toBeInstanceOf(mongoose.Types.ObjectId);
          |               ^
      425 |   });
      426 |
      427 |   await found.populate('mapped.$*');

      at test/tests/ref.test.ts:424:15
          at MongooseMap.forEach (<anonymous>)
      at Object.<anonymous> (test/tests/ref.test.ts:423:16)

@hasezoey hasezoey added this to the 8.12.1 milestone Mar 4, 2025
@hasezoey hasezoey added the dependencies Pull requests that update a dependency file label Mar 4, 2025
@hasezoey
Copy link
Collaborator Author

hasezoey commented Mar 4, 2025

Also i have noticed that there is no 8.12.0 branch or PR, should there be?

@vkarpov15
Copy link
Collaborator

Re: 8.12.0 branch or PR, I skipped the 8.12 release PR because 8.12 was just updating MongoDB Node driver version. However, in hindsight, I should've just made a PR so we could've also caught this version inconsistency. I will do so in the future. Thanks 👍

@vkarpov15 vkarpov15 merged commit f8c2bc3 into Automattic:master Mar 4, 2025
42 checks passed
@hasezoey hasezoey deleted the updateBSON branch March 5, 2025 10:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants