Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

crash in plstore-put on first run #144

Closed
bremner opened this issue Dec 27, 2017 · 12 comments
Closed

crash in plstore-put on first run #144

bremner opened this issue Dec 27, 2017 · 12 comments
Labels

Comments

@bremner
Copy link

bremner commented Dec 27, 2017

This is with 0.7.0 from melpa-stable (there's no tag for 0.7.1)
Duplicated in emacs -q, with default setting of mastodon-instance-url

Debugger entered--Lisp error: (wrong-type-argument symbolp (id . "240"))
  symbol-name((id . "240"))
  plstore-put([#<buffer  plstore /home/bremner/.emacs.d/mastodon.plstore> nil nil nil nil] "mastodon" ((id . "240") (name . "mastodon.el") (website . "https://github.com/jdenen/mastodon.el") (redirect_uri . "urn:ietf:wg:oauth:2.0:oob") (client_id . "hex-string") (client_secret . "hex-string")) nil)
  mastodon-client--store()
  mastodon-client()
  mastodon-auth--generate-token()
  mastodon-auth--get-token()
  mastodon-auth--access-token()
  mastodon-http--get("https://mathstodon.xyz/api/v1/timelines/home")
  mastodon-http--get-json("https://mathstodon.xyz/api/v1/timelines/home")
  mastodon-tl--init("home" "timelines/home" mastodon-tl--timeline)
  mastodon-tl--get-home-timeline()
  mastodon()
  funcall-interactively(mastodon)
  call-interactively(mastodon record nil)
  command-execute(mastodon record)
  execute-extended-command(nil "mastodon" "mastod")
  funcall-interactively(execute-extended-command nil "mastodon" "mastod")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)
@erkin
Copy link

erkin commented May 8, 2018

I can also reproduce this with a clean setup. I'm inclined to guess it's caused by (plstore-put) expecting a string, a plist and an optional plist; but receiving a string, an alist and nil instead, according to the error message.

I think it's because when (json-read-from-string) is called, (json-read) guesses that it's an alist as opposed to plist since json-key-type is nil and json-object-type is alist by default.

@hdurer
Copy link
Collaborator

hdurer commented May 8, 2018

That's weird. You even point to our code where we are let-binding json-object-type to be plist around the call to json-read-from-string.

@wilhelmy
Copy link

I'm experiencing the same problem and now I'm unsure how to debug it.

@baby-gnu
Copy link

I had the same issue.

I deleted the package from the Emacs package manager then reinstalled it and everything is working correctly now:

GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-05-07, modified by Debian

@erkin
Copy link

erkin commented Jul 28, 2018

I can confirm that the latest update on MELPA fixes this issue for me.

@jb55
Copy link

jb55 commented Jul 29, 2018

I'm still getting this on a fresh install

GNU Emacs 26.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2018-07-04

@jdenen
Copy link
Collaborator

jdenen commented Aug 10, 2018

I just had to replace a laptop, so I've recently re-installed Emacs (26.1) and mastodon.el. I didn't reproduce this issue.

Did you by chance have a previously created $EMACS_HOME/mastdon.plstore file? A fresh package install with an old plstore could be an issue. But I'm grasping a bit.

@jdenen jdenen added the bug label Aug 10, 2018
@jb55
Copy link

jb55 commented Aug 10, 2018

Hmmm I somehow got the error to go away while I was debugging this. For some reason json-object-type was not dynamically bound to 'plist during the json-read calls. very mysterious...

It started working when I debug-on-entry'd the json-read call, and then e + (setq json-object-type 'plist). After that it started working, even after restarting and deleting the plstore file. SPOOKY.

Now it just hangs during authentication :(

@wilhelmy
Copy link

Somehow it works for me too, now.

@fujii
Copy link

fujii commented Nov 16, 2018

I installed mastodon-20180811.220 from Melpa today, and met this issue.
(mastodon-client--fetch) returned alist.
I byte-compiled mastodon-client.el, and reloaded. Then, (mastodon-client--fetch) returned plist.
I uploaded disassembled mastodon-client--fetch of before and after byte-recompiling, and the diff.
https://gist.github.com/fujii/a88a5b0ed26581a34a6a240450b2c362

@fujii
Copy link

fujii commented Nov 16, 2018

This seems a lexical binding issue. I think mastodon-client.el needs (require 'json) to tell json-* are special variables.

@mooseyboots
Copy link
Owner

feel free to re-open if this appears again.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

9 participants