Skip to content

Nodejs transaction redesign feature branch 4 all call types #4

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

Open
wants to merge 55 commits into
base: nodejs-transaction-redesign-feature-branch-2-adding-commit
Choose a base branch
from

Conversation

danieljbruce
Copy link
Owner

Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

Still an issue with system tests. commit still needs tweaks to work with async.
Remove the no-op, get commit tests in place.
Mocks and additional debugging hooks to introspect what is going on.
Make sure commit behaves the same way as before.
…t-tests' of https://github.com/danieljbruce/nodejs-datastore into nodejs-transaction-redesign-feature-branch-3-introducing-async-commit

# Conflicts:
#	test/transaction.ts
Make the promise simpler. Change the tests to exclude functions with promisify.
The mutex and state should be moved down to the derived class. We are going to override get/runQuery/runAggregateQuery there.
Add the hook to call run before calling commit in existing tests.
commitAsync should be resolved and then() function should be called as it was not being called before
Use the private modifier instead to hide data
withBeginTransaction will be used with all calls that begin transactions and then intend to use the mutex for locking when the begin transaction call is made.
Add #beginWithCallback so that all the read calls can be made with one line of code.
The generic parameter should be used for types with run.
More specific types are better and it make code easier to read
runQuery should make the call to begin the transaction first if that hasn’t already happened yet.
Fixes for run aggregation query. Still getting undefined results.
Make sure that runAggregateQuery return results make it back to the user.
runAggregateQuery should not be excluded by promisify. Otherwise it will not return a promise, but we want it to return a promise.
Change the test to use deep strict equal since the objects being compared will not be reference equal.
Eliminate some unused code
…t-tests' of https://github.com/danieljbruce/nodejs-datastore into nodejs-transaction-redesign-feature-branch-4-all-call-types

# Conflicts:
#	test/transaction.ts
Add modifications to runQuery to use some function to return values
Don’t start commit with a promise or the promise will run early.
get should use the same pattern as runQuery and runAggregationQuery to use a resolver for the mutex business logic
#beginWithCallback is no longer used so remove it
This function is no longer used
#someFunction should be named differently
A deepStrictEqual check is all that is needed in this test that currently reuses a transaction.
If we add a delay to the tests then the mutex has the opportunity to unlock before running the tests.
We want to make sure that the calls get delivered and received in order
Put the testing tool in an object so that we can explore more orderings and possibilities.
Allow expected order to be passed into the tester. This will make the object reusable.
Need a check to be sure that the transaction is not in progress if making another beginTransaction call.
…mit' of https://github.com/danieljbruce/nodejs-datastore into nodejs-transaction-redesign-feature-branch-2a-adding-commit-and-tests

# Conflicts:
#	test/transaction.ts
Remove the NOT_TRANSACTION and default to NOT_STARTED
Remove only and let all unit tests run
Use an enum to track transaction state.
Excludes should contain the right functions in the right order.
Regroup functionality to simplify the run function
…mmit-and-tests' of https://github.com/danieljbruce/nodejs-datastore into nodejs-transaction-redesign-feature-branch-4-all-call-types

# Conflicts:
#	src/transaction.ts
#	test/transaction.ts
Explain purpose of testing objects
The merge added a bug because the pound sign wasn’t used and it should have been.
Remove constructor parameter that is not used. Add comments to functions so that the tests are more readable.
Functions in transaction.ts need JSdoc comments.
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.

1 participant