-
Notifications
You must be signed in to change notification settings - Fork 592
refactor(Notes): Make set.get_notes fail if it returns no notes #4988
Description
We currently have a limits value so that we don't return (and delete!) more than a certain number of notes - this is typically used in conjunction with sorting to e.g. get the largest value note, etc. However, there are no constraints on the minimum number of notes.
The minimum number is not typically a very interesting value (why would an application care that it gets at least 5 notes?), except for one scenario: making sure we retrieved at least a single one. I argue that we always want to enforce this, since get_notes returning no notes is meaninless: no assertions are performed (since there are no values to return), and note non-existance is not proven (since a malicious PXE could simply choose to not return the notes). Therefore, a call to get_notes that results in no notes being returned is always 'wrong'.