Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
fix: avoid truncating memo batch attachments (#5654)
Mudkipff3e4c5cfe6c
diff --git a/store/attachment.go b/store/attachment.goindex f9897d08e..41f84abfa 100644--- a/store/attachment.go+++ b/store/attachment.go@@ -80,11 +80,12 @@ func (s *Store) CreateAttachment(ctx context.Context, create *Attachment) (*Attafunc (s *Store) ListAttachments(ctx context.Context, find *FindAttachment) ([]*Attachment, error) {// Set default limits to prevent loading too many attachments at once- if find.Limit == nil && find.GetBlob {+ shouldApplyDefaultLimit := find.Limit == nil && len(find.MemoIDList) == 0+ if shouldApplyDefaultLimit && find.GetBlob {// When fetching blobs, we should be especially careful with limitsdefaultLimit := 10find.Limit = &defaultLimit- } else if find.Limit == nil {+ } else if shouldApplyDefaultLimit {// Even without blobs, let's default to a reasonable limitdefaultLimit := 100find.Limit = &defaultLimit