simplenote2.el icon indicating copy to clipboard operation
simplenote2.el copied to clipboard

not all notes are listed

Open verajosemanuel opened this issue 4 years ago • 6 comments

Fresh installed plugin and browsing notes only 6 are shown (I have more than 45) in addition, I can not access any other note than listed

verajosemanuel avatar Dec 30 '19 12:12 verajosemanuel

Problem still exists?

tlkahn avatar Jan 16 '20 19:01 tlkahn

Yes, tested on two different machines. Latest Ubuntu both

verajosemanuel avatar Jan 18 '20 21:01 verajosemanuel

I found one way around it. I am not sure if this is the correct fix, but here is my finding.

In function: (defun simplenote2--get-index-deferred (&optional index mark)

change this line: (if (equal (cdr (assq 'deleted (cdr (assq 'd e)))) :json-false)

to this: (if (not (equal (cdr (assq 'deleted (cdr (assq 'd e)))) 1))

Basically it was filtering on messages that have this attribute: (deleted . :json-false) but only a few messages have this attribute, so the list was small. Delete messages seem to have (deleted . 1) By doing the not of this test, seems to get all the messages.

I am sure there is a proper fix, but I haven't seen enough messages to determine that.

stuartclayman avatar Oct 26 '20 22:10 stuartclayman

The problem is that different clients set the value of the deleted flag differently. The backend accepts both true/false and 1/0 when a note is deleted/updated and for some reason returns this value unchanged when the list is fetched, resulting in a mixture of boolean styles in many cases. So in order to filter the list as intended, one has to treat both ways of representing a boolean as equivalent. Thus the change by @stuartclayman will not work for everyone. Maybe something like this would work instead:

(if (member (cdr (assq 'deleted (cdr (assq 'd e)))) '(:json-false 0))

bk avatar Nov 15 '20 23:11 bk

any fix on this? the mentioned workaround is not working on my pc.

verajosemanuel avatar May 10 '21 14:05 verajosemanuel

The fix suggested by @bk appears to work with notes shared between emacs, ios, web and electron clients.

zzkt avatar Jul 13 '21 16:07 zzkt