Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

fix(createOrUpdateIdent): Ensure it finds twice in case of duplicate #82

Merged
merged 5 commits into from
Sep 13, 2018

Conversation

ht2
Copy link
Contributor

@ht2 ht2 commented Sep 12, 2018

No description provided.

@ht2
Copy link
Contributor Author

ht2 commented Sep 12, 2018

Wraps the findOneOrUpdate in a try/catch block, that will recall the function if a duplicate is found, the second time round, this duplicate will simply be found and updated (rather than attempted to be created, as happened the first time, when the document was not actually there yet).

Apparently, this means, that findOneAndUpdate is NOT atomic.

Boooooooo

Copy link
Member

@ryasmi ryasmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍

@ryasmi ryasmi merged commit ef59b9a into master Sep 13, 2018
@ryasmi ryasmi deleted the duplicate-ident-fix branch September 13, 2018 07:21
@HT2Bot
Copy link
Member

HT2Bot commented Sep 13, 2018

🎉 This PR is included in version 1.6.13 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants