-
Notifications
You must be signed in to change notification settings - Fork 0
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: add deleted to table Doc #18
Conversation
Tests are failing since it doesn't seem to catch that `deleted` is an optional field
I intuitively added |
CI tests are failing because of the change to package-lock The approach sounds right, but I don't think the code you have done is pushed? Tests will need updated of course to include tests for deleted docs. The syntax for an optional prop in JSDoc is |
Is there any more to add besides the
For starters, if we add |
Also, removed deleted from `db.prepare`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few thoughts and pointers:
- We need to store deleted in the index, because we read data from the index, so it needs to be in the SQLite table
- Things are going to be easier if we define
deleted
as a field that always exists, and is eithertrue
orfalse
assertMatchingSchema
should check that the deleted field is in the schema (because it needs to be there see (1))- Tests will need updated to create a table with the correct schema, and any assertions that are not expecting the deleted field will need updated
- Can you revert the package-lock.json - I can't really evaluate why tests are failing because tests aren't running in CI.
Also, fixed tests to contemplate `deleted` and reverted package-lock.json to `main`
Pull Request Test Coverage Report for Build 6315587175
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should return deleted as a boolean - tests are expecting a number 0
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you include a test that actually tests when deleted=true
? Maybe in the scenarios?
I made |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great stuff 👍
@tomasciccola just wanted to follow up on this so that there is a record of it. Because we read this data via drizzle, that takes care of converting 1 | 0 into a boolean on read. It's the same with the JSON fields (drizzle does JSON parse). We definitely shouldn't cast it because that would be a lie and would lead to bugs. How you have done it is good. |
Pull Request Test Coverage Report for Build 6315587175Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
1 similar comment
Pull Request Test Coverage Report for Build 6315587175Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
would close #8