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

✅ Add OP_ALREADY_SUBMITTED test for create ops #658

Merged
merged 1 commit into from
May 23, 2024

Conversation

alecgibson
Copy link
Collaborator

We have logic that tries to differentiate between:

  • a create op that is incorrectly trying to create a Doc that already exists
  • a create op that has already been committed, and has been resubmitted (possibly because the connection closed before the ack was received)

The latter case is not currently covered by tests.

This change adds a test to cover this branch, and a second similar test which explains why #657 was not a viable change (and correctly fails for that case).

We have [logic][1] that tries to differentiate between:

 - a create op that is incorrectly trying to create a `Doc` that already
   exists
 - a create op that has already been committed, and has been resubmitted
   (possibly because the connection closed before the ack was received)

The latter case is [not currently covered by tests][2].

This change adds a test to cover this branch, and a second similar test
which explains why #657 was not a
viable change (and correctly fails for that case).

[1]: https://github.com/share/sharedb/blob/7b20313ded4c302b9416cc6c7821694a7fa491b8/lib/submit-request.js#L105-L121
[2]: https://coveralls.io/builds/67552613/source?filename=lib%2Fsubmit-request.js#L117
@coveralls
Copy link

Coverage Status

coverage: 97.439% (+0.09%) from 97.353%
when pulling 22e554d on create-collide-tests
into 7b20313 on master.

@alecgibson alecgibson merged commit f4effa3 into master May 23, 2024
8 checks passed
@alecgibson alecgibson deleted the create-collide-tests branch May 23, 2024 07:14
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.

3 participants