NotePlan / plugins

The main NotePlan repository, which contains the source code for all NotePlan plugins. If a release entry has been created, it will be available for installation from within NotePlan application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Callback Link Not Working (Projects + Reviews)

CraneRewind opened this issue Β· comments

Same behaviour as #508 but in a different plugin.

Describe the bug
In both rich and markdown view, clicking on a link results in no actions at all.

To Reproduce
Steps to reproduce the behavior:

  1. Set up at least one project for the Projects + Reviews plugin to work with.
  2. Trigger /project lists
  3. I have both rich+markdown. You should see a markdown note with links, a Review List window with links, or both. (see setup screenshot)
  4. Click links, either in markdown note or the rich dialog.

Expected behavior
I expect something to happen when I click a link. I expect to see some debug console action.

Screenshots
See attachments.

System

  • Device: Mac
  • OS: macOS14.0 (23A344)
  • NotePlan Version: 3.9.11
  • Plugin Name & Version: Projects + Reviews v0.13.0

Additional context
I don't often use callbacks like this. One plug was working perfect fine sometime last year, but I have no idea when the functionality broke.

Plugin Console Log
Not including the log because nothing happens. You can see that in the video.

Attachments
1 setup
2 debug set

3.Clicking.links.mp4

I cannot reproduce this, with the link you clicked on.
Are all the other buttons (rich style), or links (markdown style) also not doing anything?

From the screenshot you showed on Discord, the x-callback looked like it might have a space in it. It should read:
noteplan://x-callback-url/runPlugin?pluginID=jgclark.Reviews&command=start%20reviews
That's what I have, but if there's a space instead of the %20 nothing will happen. Please could you ensure that on the Markdown version it has the %20, and then try it again?

None of the buttons (rich) or links (markdown) work. The only thing that works is the link to the note containing the project, e.g., "Secret Undertaking".

The callback link pastes like this:

noteplan://x-callback-url/runPlugin?pluginID=jgclark.Reviews&command=start%20reviews

In noteplan, it looks like there's a space or linebreak after ? but I think that's just wrapping.

I tried another link:

noteplan://x-callback-url/runPlugin?pluginID=jgclark.Reviews&command=add%20progress%20update

but clicking on either of these links still has no effect. Nothing happens.

image

(Interesting that the tooltip replaces the %20 with a space, but maybe that's just for readability?)

Have just tried the link on my side (without any other setup) and it worked for me. Just showed a message that there's nothing to review. Does this work for you? Means you delete the reviewable notes and then try it?

The problem is stopping the plugin command even starting. So there's something funny in your app or the plugin installation. I suggest in order:

  • restarting app
  • deleting and reinstalling plugin (settings will be saved)
  • delete and reinstall app

JG, I've tried, but no joy.

Note: other plugins seem to work fine, e.g.,

  • AutoTimeBlockingEvents (insert today as list)
  • Dashboard (refresh and toggle buttons)

^^ not sure if either of those is using callbacks

The beta that interprets empty values in x-callback-urls properly as undefined is up and we can test this. But not sure if it helps here.

Did we already enabled logging by the way? https://help.noteplan.co/article/57-how-to-enable-logging

Oh, that logging is interesting. This is what I did:

  • deleted the old log files
  • turned on logging in noteplan
  • restarted noteplan
  • typed /projects and then selected /projects lists
  • clicked the refresh button a couple of times
  • the dialog didn't show anything, so ran /projects lists again
  • now the dialog shows something
  • clicked review
  • clicked cancel
    np-error.log
    np-out.log

I see a lot of repeat messages (even when I started typing /pro) about "np.MeetingNotes is already downloaded"; that seems like a warning. Also some bits about Dropbox, FYI, not using dropbox.

Not sure it should matter, but FYI, I don't sync my notes, dropbox and cloud are not allowed.

Last bits of np-out.log (i.e., when I clicked cancel)

AppDelegate: handleGetURLEvent called, picking the first url: noteplan://x-callback-url/runPlugin?pluginID=jgclark.Reviews&command=cancel%20project. Is the handler nil = no (cache the url if needed)
UI+URLScheme: parse incoming x-callback-url
UI+URLScheme: do something with runPlugin
Running a plugin through x-callback
Plugin 'np.MeetingNotes' is already downloaded, don't add it from the core plugins again
Coudn't run plugin, need `pluginID` or `pluginName` as parameter

Indeed interesting, I'm adding more logging to show what's available when the plugin detection fails to the next beta. I checked on my side and it can find everything. When I hit start review, it opens the Secret Undertaking note for me.

However, there's more plugin specific text in the log, maybe @jgclark has a clue what it means.

Also, if you haven't tried yet, reinstall the plugin (you probably did that already) and I would also try deleting all other plugins, but this one.

@CraneRewind I can't tell from the messages whether this is now working fully or not for you. But one thing I want to check from the logs is what your file extension for notes is. I'm guessing "txt" not "md"?

More questions for you:

  • Are you running the Setapp version?
  • Does the file "/Users/crane/Library/Containers/co.noteplan.NotePlan-setapp/Data/Library/Application Support/co.noteplan.NotePlan-setapp/Plugins/data/jgclark.Dashboard/full-review-list.md" exist? If so does it contain anything?
  • Does the note '#project Review List' exist and show something useful?

Indeed interesting, I'm adding more logging to show what's available when the plugin detection fails to the next beta. I checked on my side and it can find everything. When I hit start review, it opens the Secret Undertaking note for me.

However, there's more plugin specific text in the log, maybe @jgclark has a clue what it means.

Also, if you haven't tried yet, reinstall the plugin (you probably did that already) and I would also try deleting all other plugins, but this one.

I did try uninstall/reinstall. I've also tried deleting all the plugins (although I couldn't get rid of a couple.)

@CraneRewind I can't tell from the messages whether this is now working fully or not for you. But one thing I want to check from the logs is what your file extension for notes is. I'm guessing "txt" not "md"?

Not working yet. My file extension is "txt".

More questions for you:

  • Are you running the Setapp version?
  • Does the file "/Users/crane/Library/Containers/co.noteplan.NotePlan-setapp/Data/Library/Application Support/co.noteplan.NotePlan-setapp/Plugins/data/jgclark.Dashboard/full-review-list.md" exist? If so does it contain anything?
  • Does the note '#project Review List' exist and show something useful?
  • Yes, from Setapp.
  • "/Users/crane/Library/Containers/co.noteplan.NotePlan-setapp/Data/Library/Application Support/co.noteplan.NotePlan-setapp/Plugins/data/jgclark.Dashboard/full-review-list.md" exists and contains settings.json. Content below.
  • That note does exist. Content below.

{ "includeTaskContext" : false, "showYesterdaySection" : true, "dashboardTheme" : "", "autoAddTrigger" : false, "ignoreTasksWithPhrase" : "", "excludeTasksWithTimeblocks" : false, "ignoreChecklistItems" : true, "triggerLogging" : false, "tagToShow" : "@waiting", "maxTasksToShowInSection" : 20, "ignoreFolders" : [ "Saved Searches" ], "separateSectionForReferencedNotes" : true, "showWeekSection" : true, "showOverdueTaskSection" : true, "_logLevel" : "DEBUG", "overdueSortOrder" : "priority", "updateOverdueOnTrigger" : true, "includeFolderName" : true, "excludeChecklistsWithTimeblocks" : false }

`# #project Review List
Total 1 active projects: Start reviewing 1 ready for review (showing all open projects/areasplus finished ones.) Last updated: 2024-01-09 2:38 PM πŸ”„ Refresh
Review: Finish Finish + Next Current open project note: Add progress toggle Pause Complete Cancel

1 Projects

  • [[Secret Undertaking]] 50% done (of 4 tasks) due in 23 days Review due today`

I've tried again to reproduce this and can't.
Is this still happening for you?
If so please send contents of "/Users/crane/Library/Containers/co.noteplan.NotePlan-setapp/Data/Library/Application Support/co.noteplan.NotePlan-setapp/Plugins/data/jgclark.Dashboard/full-review-list.md" file. (Note: last time you looked in the wrong directory. This has '.../data/...' in it.)

Hi again JG. Still not working, although I'm getting better at the / commands ;)

It looks like there's more info being logged now in the np-out.log when click one of the buttons. Here, I've clicked the "Refresh" button in the Review List modal.

AppDelegate: handleGetURLEvent called, picking the first url: noteplan://x-callback-url/runPlugin?pluginID=jgclark.Reviews&command=project%20lists. Is the handler nil = no (cache the url if needed)
UI+URLScheme: parse incoming x-callback-url
UI+URLScheme: do something with runPlugin
Running a plugin through x-callback (["pluginID": "jgclark.Reviews", "command": "project lists"]
Plugin 'np.Templating' is already downloaded, don't add it from the core plugins again
Coudn't run plugin, need `pluginID` or `pluginName` as parameter, parameters: ["pluginID": "jgclark.Reviews", "command": "project lists"]
Plugin 'np.Templating' is already downloaded, don't add it from the core plugins again
Available plugins: ["Name: πŸ—“ AutoTimeBlocking / Events, ID: dwertheimer.EventAutomations", "Name: πŸŽ› Dashboard, ID: jgclark.Dashboard", "Name: πŸ•“ Event Helpers, ID: jgclark.EventHelpers", "Name: ⭐️ Favorites, ID: dwertheimer.Favorites", "Name: ✍️ Meeting Notes, ID: np.MeetingNotes", "Name: πŸ”’ Note Statistics, ID: np.statistics", "Name: ⬇️ Plugin Installer, ID: np.installer", "Name: ⚑️ Quick Capture, ID: jgclark.QuickCapture", "Name: 🀝 Shared Resources, ID: np.Shared", "Name: πŸ“’ Templating, ID: np.Templating", "Name: 🧹 Tidy Up, ID: np.Tidy"]

I find it weird that

  1. It wants pluginID and it looks like pluginID is in the params.
  2. This plugins is not listed in the list of Available plugins. Nor is the habit tracker. I don't know if that's part of the issue, or they just don't show up because they don't show up in the Plugins menu drop-down.

I'm looking for that file. No md in that particular directory.

~/L/Containers/co./D/L/Application Su/c/P/data/jgclark.Dashboard ξ‚° pwd
/Users/crane/Library/Containers/co.noteplan.Noteplan-setapp/Data/Library/Application Support/co.noteplan.NotePlan-setapp/Plugins/data/jgclark.Dashboard

  07.03.24 14:11 ξ‚° 0s ξ‚° βœ” ξ‚°-----------------------------------------------------------------------------------------------------------ξ‚² 3.0.6 οˆ™
 ~/L/Containers/co./D/L/Application Su/c/P/data/jgclark.Dashboard ξ‚° ls -la
   rwxr-xr-x    3   crane   staff     96 B     Mon May  1 16:13:05 2023  ο„•  ./
   rwxr-xr-x   19   crane   staff    608 B     Fri Feb  2 16:02:21 2024  ο„•  ../
   rw-r--r--    1   crane   staff    642 B     Wed Jan 10 16:03:54 2024  ξ˜‹  settings.json

but there is one in the .../jgClark.Reviews directory. Contents

---
title: full-review-list
date: 2024-03-07T10:50:56-05:00
key: reviewDays	dueDays	title	folder	tags	state
---
2	NaN	P: xxx	1 Projects	#project 	active
31	NaN	P: xxx	1 Projects	#project 	active
7	NaN	P: xxx	1 Projects	#project 	active
0	NaN	A: xxx	2 Areas	#area 	active
24	NaN	A: xxx	2 Areas	#area 	active
0	NaN	A: xxx	2 Areas	#area 	active
0	NaN	A: xxx	2 Areas	#area 	active%

I had to elide the actual names though.

@EduardMe thanks for adding more logging. The additional details in the np-out.log from @CraneRewind in the previous post gives several important leads:

  • Confirms the callback is arriving in NP and being parsed
  • Looks an error in logic (or perhaps unclear logging) given Coudn't run plugin, need pluginIDorpluginName as parameter, parameters: ["pluginID": "jgclark.Reviews", "command": "project lists"]
  • Unclear why several installed plugins aren't appearing in Available plugins: [...]

The fact that the plugin of interest here isn't in that list probably explains why the callbacks aren't doing anything. So the question is why does NP not have it in its list of installed ones?

@jgclark I have an idea. Might be these plugins were disabled? It's not showing disabled plugins in "Available plugins...", so NotePlan doesn't select it for the x-callback. I can set this to also scan disabled plugins and upload the beta again to test this.

Another way to test it, is to change the plugin ID, but that also messes with the x-callback-url, but would be faster. I just uploaded a beta without the changes, so will upload another tomorrow or so.

@CraneRewind , is it possible you disabled the plugin at some point in time (we have removed the enable button some while ago)?

@EduardMe yes, I likely disabled it, enabled it, uninstalled it, reinstalled it, etc. etc. trying to get it to work properly.

It shows as installed in the Preferences.
image

It is 'installed' in that it works, just not the callbacks.

Is there some file I can check/fix to have it show up in your list properly again?

It's difficult to access the preferences now. You could try to change the ID in the plugin.json file and adapt the callback as well, or wait and I'll upload a beta which ignores the disabled flag (we should have done that anyways). Here's a link to TestFlight, in case you are not on it. We're fixing some more thing today and upload this final beta ready for release (I hope): https://testflight.apple.com/join/fm9q4OjE

Thanks Eduard! I'm using NotePlan through Setapp, so I'll wait for the eventual fix. It's nice to have a better idea of the "why" now.

@jgclark I have an idea. Might be these plugins were disabled? It's not showing disabled plugins in "Available plugins...", so NotePlan doesn't select it for the x-callback. I can set this to also scan disabled plugins and upload the beta again to test this.

Sorry, only just seen this, @EduardMe . I've not done anything on my end to disable any plugins. And given its showing in his list of plugins, I'm not sure what you mean. But you've since released a new beta: what did that change?

@CraneRewind I think this can also be closed now?

Yes! I've just installed the newest version (3.10.2) through Setapp and the links for my two plugins are working. Excellent! Thank you very much.