brantje / nextnote

A full Evernote / OneNote style WYSIWYG note editor for Nextcloud / ownCloud. Join our telegram at: https://t.me/NextNote
GNU Affero General Public License v3.0
163 stars 19 forks source link

note service: lazy load notes. Fixes #37 #38

Closed mulander closed 6 years ago

mulander commented 7 years ago

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

enoch85 commented 6 years ago

@brantje Can you have a look please?