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

feat: mongo transactions #198

Merged
merged 23 commits into from
Jan 26, 2024
Merged

feat: mongo transactions #198

merged 23 commits into from
Jan 26, 2024

Conversation

niall-shaw
Copy link
Collaborator

@niall-shaw niall-shaw commented Jan 5, 2024

Solves the same problem as #197, but by using transactions instead of manual deletions / updates.
This has the added benefit of not exposing any unnecessary delete functions, but requires some extra overhead of creating and passing a mongo session.

Sessions and transactions require mongodb replica sets, which is why there were several changes required to be made to the docker-compose.

I believe this is the better/correct approach, as production uses replica sets anyway.

Unfortunately, it isn't possible to start the default github actions' mongodb service with replica sets, hence the use of the third party action.

Working with docker-compose, tilt, local development (i.e. yarn dev) and CI.

Note: For local development, or environments using single node replica sets, you must include ?directConnection=true as part of your connection string.

packages/backend/src/email/client-stub.ts Outdated Show resolved Hide resolved
packages/frontend/src/common/hooks.ts Outdated Show resolved Hide resolved
.docker/mongodb/scripts/mongosetup.sh Outdated Show resolved Hide resolved
packages/backend/src/submission/controller.ts Outdated Show resolved Hide resolved
packages/backend/src/submission/mongoRepository.ts Outdated Show resolved Hide resolved
packages/backend/src/entity/mongoRepository.ts Outdated Show resolved Hide resolved
packages/frontend/src/common/hooks.ts Outdated Show resolved Hide resolved
.docker/mongodb/scripts/rs-init.js Outdated Show resolved Hide resolved
packages/backend/src/email/client-stub.ts Outdated Show resolved Hide resolved
.docker/mongodb/initdb.d/usercreate.sh Outdated Show resolved Hide resolved
@niall-shaw niall-shaw merged commit 3412883 into main Jan 26, 2024
5 checks passed
@niall-shaw niall-shaw deleted the feat/mongo-transactions branch January 26, 2024 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants