magit / forge

Work with Git forges from the comfort of Magit
GNU General Public License v3.0
1.33k stars 117 forks source link

Can't list global topics, issues, or pull requests #725

Closed pacaroha closed 2 weeks ago

pacaroha commented 2 weeks ago

The problem

Even though listing repositories works fine, as does listing topics specific to a particular repo in the DB, listing global topics always fails with eieio-oref@closql-object: Wrong type argument: (or eieio-object cl-structure-object oclosure), nil.

I've tried adding a couple of repos from my work GitLab instance, and had this issue with both. I tried adding a GitHub repository and removing all of the GitLab repos at the self-hosted instance to no avail.

I'm really not sure what's going wrong here. The SQLite DB does have entries for the repos in question (although the value in the issues column for them is always eieio-unbound). Idrk what I'm doing but I can even get objects out of them, it seems, using forge-get-repository.

My environment

Fwiw, I am storing the API tokens for GitHub and our self-hosted GitHub instance with auth-sources-pass-- not sure if that could be a factor.

I looked for similar issues, those with that same message and others, and saw that sometimes they were a result of some kind of version mismatch. I've deleted my entire straight build directory and rebuilt all packages, but that didn't help. I also temporarily uninstalled other packages that depended on emacsql so that they couldn't pull in some other version, but that didn't help either. I'm using Doom Emacs, and have tried first upgrading/rebuilding my packages and then upgrading Doom itself, which brought along some other package upgrades, but neither made a difference. I have nuked the forge-database-file every time I've played with version changes.

My Emacs does have sqlite support built-in.

Backtrace

Debugger entered--Lisp error: (wrong-type-argument (or eieio-object cl-structure-object oclosure) nil)
  #<subr eieio-oref>(nil id)
  eieio-oref@closql-object(#<subr eieio-oref> nil id)
  apply(eieio-oref@closql-object #<subr eieio-oref> (nil id))
  eieio-oref(nil id)
  (list 'forge-buffer-repository (eieio-oref repo 'id))
  (list (list 'forge-buffer-repository (eieio-oref repo 'id)) (list 'forge--buffer-topics-spec spec) (list 'forge-buffer-unassociated-p global))
  (magit-setup-buffer-internal #'forge-topics-mode nil (list (list 'forge-buffer-repository (eieio-oref repo 'id)) (list 'forge--buffer-topics-spec spec) (list 'forge-buffer-unassociated-p global)) (get-buffer-create buf) dir)
  (let* ((global (or (plist-get params :global) (and spec (eieio-oref spec 'global)))) (repo (or repo (and (not global) (let* ((topic ...) (repo ...)) (if repo repo (forge-get-repository :tracked?)))))) (dir (or (and repo (forge-get-worktree repo)) "/")) (buf (forge-topics-buffer-name repo)) (buf (or (get-buffer buf) buf)) (spec (cond (spec (clone spec)) ((and (bufferp buf) (buffer-local-value 'forge--buffer-topics-spec buf))) ((clone forge-list-buffer-default-topic-filters))))) (catch 'done310 (while t (let* ((key (and t (car-safe ...)))) (if key (progn (eieio-oset spec key (car-safe ...))) (throw 'done310 nil))))) (if (eieio-oref spec 'type) nil (eieio-oset spec 'type 'topic)) (if (or repo global) nil (error "Cannot determine repository")) (magit-setup-buffer-internal #'forge-topics-mode nil (list (list 'forge-buffer-repository (eieio-oref repo 'id)) (list 'forge--buffer-topics-spec spec) (list 'forge-buffer-unassociated-p global)) (get-buffer-create buf) dir))
  forge-topics-setup-buffer(nil nil :global t)
  forge-list-global-topics()
  funcall-interactively(forge-list-global-topics)
  command-execute(forge-list-global-topics record)
  execute-extended-command(nil "forge-list-global-topics" nil)
  funcall-interactively(execute-extended-command nil "forge-list-global-topics" nil)
  command-execute(execute-extended-command)

Magit version

Magit v4.1.1-22-gf2a6133, Transient 0.7.9, Forge 0.4.4, Git 2.39.5, Emacs 29.4, darwin

Other comments

Thank you very much for this package! Its functionality is awesome. I'm a bit of a novice. In case this bug report is not sufficient to reproduce or diagnose the issue, I would be deeply grateful for your patience in helping me debug the issue. I want to learn more about how this and related packages work.

I haven't yet had time to see if I can repro with vanilla Emacs, but I would be happy to try if this seems it could be a Doom quirk.

tarsius commented 2 weeks ago

Thanks for the report!