Previously fetching a list of notes eagerly loaded
all note parts, this could lead to the whole fetch
failing for large notebooks when the fetch is
interrupted either by reaching a request timeout
or hitting a transfer limit. This was observed
in the wild on a notebook containing 702 notes which
failed to load after hitting 7 MB on the wire in over
1 minute.
To resolve the problem we don't rely on the loaded
list of notes when acting upon a single note. Instead
we always hit the single note 'find' endpoint re-fetching
the note and its parts. We also remove the parts fetching
from the 'findNotesFromUser' path responsible for providing
the index of notes.
On top of fixing the problem this greatly speeds up obtaining
the list of notes for the cost of additional small requests
when accessing specific notes.
Previously fetching a list of notes eagerly loaded all note parts, this could lead to the whole fetch failing for large notebooks when the fetch is interrupted either by reaching a request timeout or hitting a transfer limit. This was observed in the wild on a notebook containing 702 notes which failed to load after hitting 7 MB on the wire in over 1 minute.
To resolve the problem we don't rely on the loaded list of notes when acting upon a single note. Instead we always hit the single note 'find' endpoint re-fetching the note and its parts. We also remove the parts fetching from the 'findNotesFromUser' path responsible for providing the index of notes.
On top of fixing the problem this greatly speeds up obtaining the list of notes for the cost of additional small requests when accessing specific notes.
Signed-off-by: Adam Wolk adam.wolk@tintagel.pl