Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite message loop? #36

Closed
laurent22 opened this issue Feb 7, 2021 · 3 comments
Closed

Infinite message loop? #36

laurent22 opened this issue Feb 7, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@laurent22
Copy link
Collaborator

laurent22 commented Feb 7, 2021

I've just noticed that the plugin keeps sending messages at regular interval. If you check the main console, you'll see these messages in a loop:

main-html.js:48 12:26:08: PluginRunner: Got message (3): joplin.workspace.selectedNote
main-html.js:48 12:26:08: PluginRunner: Got message (3): joplin.settings.globalValue showCompletedTodos
main-html.js:48 12:26:08: PluginRunner: Got message (3): joplin.views.panels.setHtml <hidden>
main-html.js:48 12:26:08: PluginRunner: Got message (3): joplin.settings.setValue noteTabs []
main-html.js:48 12:26:09: Saving settings...
main-html.js:48 12:26:09: Settings have been saved.

I didn't see anything obvious in the code that could cause this, but it might be an event listener that indirectly triggers an event, which is then again caught by the same listener. It could be worth checking this as it could drain the user's battery.

@benji300
Copy link
Owner

benji300 commented Feb 7, 2021

Oh... didn't recognized that. Of course I will have a look at it as soon as possible. Thanks for the hint.

@benji300
Copy link
Owner

Hello @laurent22,

I cannot reproduce this behavior on my side. I can't see any messages from PluginRunner. They only message I see comes on App start and says:

DevTools failed to load SourceMap: Could not load content for file:///C:/Program%20Files/Joplin/resources/app.asar/PluginRunner.js.map: 

Could that be a problem?

I get the following bunch of messages on when starting Jopin in Dev mode and the plugin specified via the development plugins. But when I do nothing, I get no more messages.

image

Except I select another note, then I get the following messages.

image

I've also tested to install the plugin in dev mode, but no change.

  • What is the approximate time interval you receive these messages?
  • Which version of the plugin you're using?

My Setup:

Joplin 1.7.11 (dev, win32)

Client ID: e8cd6740a96d4da78f033fac4ae93de1
Sync Version: 2
Profile Version: 34
Keychain Supported: Yes

Revision: f560563d8 (master)

@benji300
Copy link
Owner

All right... I found the problem. Surprisingly, though, I really don't get the messages. But a debug output in Settings.onChange() showed the problem.

image

I guess this should be easily fixed. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants