-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix bug when materialising documents containing (non-existent) pinned relations #177
Conversation
Codecov Report
@@ Coverage Diff @@
## main #177 +/- ##
==========================================
+ Coverage 90.53% 90.55% +0.01%
==========================================
Files 43 43
Lines 2885 2985 +100
==========================================
+ Hits 2612 2703 +91
- Misses 273 282 +9
Continue to review full report at Codecov.
|
let document_id = match resolve_document_id(&context, &input).await? { | ||
Some(document_id) => Ok(document_id), | ||
None => { | ||
debug!("No document found for this view, exit without dispatching any other tasks"); | ||
return Ok(None); | ||
} | ||
}?; |
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.
Instead of returning Ok(None)
when a document for a requested view didn't exist, we were critically failing the task here.
Logic bug....
I think the test coverage drops here because all the |
* main: Update CHANGELOG.md Refactor replication API (#184) GraphQL replication client (#137) Update aquadoggo to v0.3.0 in aquadoggo_cli v0.3.0 Prepare CHANGELOG for v0.3.0 release Commit Cargo.lock p2panda-rs v0.4.0 Remove unused import Update naming in `publishEntry` query and `nextEntryArgs` response (#181) Fix bug when materialising documents containing (non-existent) pinned relations (#177) Logging in reduce task (#175) Refactor test db creation (#176)
* schema-provider: Minor clean ups Move to unreleased section in CHANGELOG Update CHANGELOG.md Refactor replication API (#184) GraphQL replication client (#137) Update aquadoggo to v0.3.0 in aquadoggo_cli v0.3.0 Prepare CHANGELOG for v0.3.0 release Commit Cargo.lock p2panda-rs v0.4.0 Remove unused import Update naming in `publishEntry` query and `nextEntryArgs` response (#181) Fix bug when materialising documents containing (non-existent) pinned relations (#177)
When the materialiser comes across a pinned relations it kicks off a reduce task for each document view being related to. This is the correct behaviour. But then our clever reduce task was freaking out if there was no document for the requested document view already in the store. This is buggy behaviour. This PR fixes it by not critically failing the task but instead exiting the task silently. Also adds a test for this case.
branch includes unmerged changes from: #175 + #176
📋 Checklist
CHANGELOG.md