paulbricman / dual-obsidian-client

A skilled virtual assistant for Obsidian.
https://paulbricman.com/thoughtware/dual
Mozilla Public License 2.0
242 stars 7 forks source link

Online notebook crashes with huge snapshots #21

Closed paulbricman closed 3 years ago

paulbricman commented 3 years ago

User reports 70K lines as an upper limit. Conversely, small snapshots should be met with a warning.

paulbricman commented 3 years ago

Apparently it's the text input which messes everything, with a hard limit at ~7M characters.

paulbricman commented 3 years ago

Added a code cell just after the snapshot:

if len(snapshot) < 30000:
  print('Your vault snapshot is too small and is unlikely to yield interesting results!')
elif len(snapshot) > 5000000:
  print('Your vault snapshot is huge! Trimming to fit in memory...')
  snapshot = snapshot[:5000000]
else:
  print('Your vault size is ideal!')

However, the plugin itself when copying the snapshot to clipboard should take the first 5M or so characters, in order not to obliterate the input box.