wombag icon indicating copy to clipboard operation
wombag copied to clipboard

Archiving items sometimes errors

Open peterstuart opened this issue 1 year ago • 0 comments

I sometimes get this error when archiving, and it seems to result in most of the rows in the items table being removed from the sqlite DB:

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  substring(nil 0 10)
  (or (substring created-at 0 10) (and published-at (substring published-at 0 10)))
  (propertize (or (substring created-at 0 10) (and published-at (substring published-at 0 10))) 'face 'wombag-date-face)
  (format "%s %s %s %s (%s)" (propertize (or (substring created-at 0 10) (and published-at (substring published-at 0 10))) 'face 'wombag-date-face) (propertize (truncate-string-to-width title wombag-search-title-width nil 32 nil) 'face (if (= is-archived 1) 'wombag-archive-face 'wombag-title-face)) (propertize (format "%3d min" reading-time) 'face 'wombag-reading-time-face) (propertize domain-name 'face 'wombag-domain-face) (concat (and (eq is-starred 1) (concat (propertize "★" 'face 'wombag-starred-face) (if (string-empty-p tag) nil ","))) (propertize tag 'face 'wombag-tag-face)))
  (let* ((title (or (alist-get 'title entry) "NO TITLE")) (created-at (alist-get 'created_at entry)) (published-at (alist-get 'published_at entry)) (reading-time (alist-get 'reading_time entry)) (is-archived (alist-get 'is_archived entry)) (is-starred (alist-get 'is_starred entry)) (tag (alist-get 'tag entry)) (domain-name (or (alist-get 'domain_name entry) "")) (authors (mapconcat #'identity (alist-get 'published_by entry) ","))) (format "%s %s %s %s (%s)" (propertize (or (substring created-at 0 10) (and published-at (substring published-at 0 10))) 'face 'wombag-date-face) (propertize (truncate-string-to-width title wombag-search-title-width nil 32 nil) 'face (if (= is-archived 1) 'wombag-archive-face 'wombag-title-face)) (propertize (format "%3d min" reading-time) 'face 'wombag-reading-time-face) (propertize domain-name 'face 'wombag-domain-face) (concat (and (eq is-starred 1) (concat (propertize "★" 'face 'wombag-starred-face) (if (string-empty-p tag) nil ","))) (propertize tag 'face 'wombag-tag-face))))
  wombag-search-format-entry(nil)
  (insert (wombag-search-format-entry entry))
  (let (beg end) (setq beg (point)) (insert (wombag-search-format-entry entry)) (setq end (point)) (put-text-property beg end 'wombag-entry entry) (put-text-property beg end 'wombag-id (alist-get 'id entry)) (insert "\n"))
  (if (equal entry "") nil (let (beg end) (setq beg (point)) (insert (wombag-search-format-entry entry)) (setq end (point)) (put-text-property beg end 'wombag-entry entry) (put-text-property beg end 'wombag-id (alist-get 'id entry)) (insert "\n")))
  wombag-search-print-entry--default(nil)
  (save-excursion (goto-char location) (delete-line) (wombag-search-print-entry--default (car (wombag-db-get-ids id))))
  (let ((state (map-elt data field)) (updated-at (map-elt data 'updated_at)) (inhibit-read-only t)) (wombag-db-update field id state) (wombag-db-update 'updated_at id updated-at) (save-excursion (goto-char location) (delete-line) (wombag-search-print-entry--default (car (wombag-db-get-ids id)))))
  (save-current-buffer (set-buffer (wombag-search-buffer)) (let ((state (map-elt data field)) (updated-at (map-elt data 'updated_at)) (inhibit-read-only t)) (wombag-db-update field id state) (wombag-db-update 'updated_at id updated-at) (save-excursion (goto-char location) (delete-line) (wombag-search-print-entry--default (car (wombag-db-get-ids id))))))
  (progn (setq wombag-retrieving nil) (save-current-buffer (set-buffer (wombag-search-buffer)) (let ((state (map-elt data field)) (updated-at (map-elt data 'updated_at)) (inhibit-read-only t)) (wombag-db-update field id state) (wombag-db-update 'updated_at id updated-at) (save-excursion (goto-char location) (delete-line) (wombag-search-print-entry--default (car (wombag-db-get-ids id)))))))
  (let* ((data (car (cdr (plist-member --cl-rest-- ':data))))) (progn (setq wombag-retrieving nil) (save-current-buffer (set-buffer (wombag-search-buffer)) (let ((state (map-elt data field)) (updated-at (map-elt data 'updated_at)) (inhibit-read-only t)) (wombag-db-update field id state) (wombag-db-update 'updated_at id updated-at) (save-excursion (goto-char location) (delete-line) (wombag-search-print-entry--default (car (wombag-db-get-ids id))))))))

I removed the bottom of the backtrace because it contained my access token, etc, but if it'd be helpful to have, I can provide a redacted version.

Thanks for the package!

peterstuart avatar Mar 09 '24 12:03 peterstuart