smartin015 / continuousprint

Octoprint plugin to allow the creation of a print queue that prints, clears the bed and then prints again
40 stars 38 forks source link

TabOrder plugin conflict prevents adding to queue (Knockout-Sortable library name collision) #14

Closed L0rz closed 2 years ago

L0rz commented 2 years ago

i Can,t add annything to the Q after update from 1.3.1 to you version. first i remove the old version and hold my setings, after this teh Settings page has the right setting but the print q was empti, so i remove the plugin again whith remove of my settings restart and install it again.

But i still can´t add anything to the list. 2022-03-14 14_26_05-0% - (operational) - Vivaldi

Tiri1i1 commented 2 years ago

Same issue observed on version 1.4.1, Print queue is always empty no matter my actions

leveos commented 2 years ago

i can comfirm the same problem. it appears to be a visual bug for me though. if i click the plus sign to add a file to the queue nothing showes up but if i then press start managing it starts to print the file that i added. still not usable in this state but i hope that helps narrow it down

smartin015 commented 2 years ago

Hey all, thanks for the reports, and sorry this wasn't a flawless upgrade - I'm doing some development work to hopefully make updates a bit more smooth moving forward.

If any of you are using Chrome, can you:

  1. Use Ctrl+Shift+C keyboard shortcut to open the dev tools
  2. click on the "Console" tab,
  3. right-click and "Save As" to get a log file
  4. Upload it to a comment here?

(see also here for a visual)

Going by the comment from @leveos, there's probably something going on in the page itself that's causing failure to render the files. Listing out which particular browser you're using (Chrome? Firefox? Edge? etc) might also help narrow the problem down.

smartin015 commented 2 years ago

Actually - just pushed some additional logging to try and make the problem more obvious. Can you please follow the .zip style instructions here to pull those changes, and try with that?

leveos commented 2 years ago

Hi just wanted to update you on the new issue. I now tried to reinstall 1.4.1 from the plugin manager just using the search function that’s built in. and it installs as unknown. Which shows up no where in my plugins.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: nathan @.> Sent: Tuesday, March 15, 2022 2:49 PM To: @.> Subject: RE: [smartin015/continuousprint] Not Possible to add Items to Q (Issue #14)

Hi,

Sorry for the delay. I had to work my day job. I uninstalled version 1.4.1 and cleaned up data. Now reinstalled from the master.zip file from the URL you provided. But now there is no continuous print plugin at all.

Using another one of my printers that still has the 1.4.1 installed I pulled the data you asked for previously.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: Scott @.> Sent: Tuesday, March 15, 2022 1:59 PM To: @.> Cc: @.>; @.> Subject: Re: [smartin015/continuousprint] Not Possible to add Items to Q (Issue #14)

Actually - just pushed some additional logging to try and make the problem more obvious. Can you please follow the .zip style instructions herehttps://github.com/smartin015/continuousprint#add-the-plugin to pull those changes, and try with that?

— Reply to this email directly, view it on GitHubhttps://github.com/smartin015/continuousprint/issues/14#issuecomment-1068467797, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS2U63TG5ITIKSRW2IHF7JTVAD225ANCNFSM5QVQ3ZOA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>

Tiri1i1 commented 2 years ago

Same issue, I installed again the plugin using the .zip URL (https://github.com/smartin015/continuousprint/archive/master.zip) but it's tagged as Unknown and doesn't show up anymore. I did test beforehand, and the Queue system does not work. Only the first part added is printed, but when it's finished it does not switch to the next part.

smartin015 commented 2 years ago

Just squashed the bug with installation - I verified in a test instance that I can install the plugin, reboot, and it shows up (after verifying that it showed up as unknown before). Try one more time? There should be additional console logs that I can use to help narrow things down.

smartin015 commented 2 years ago

@leveos, I think your email reply ate your attachment. Can you post it to the github issue directly?

leveos commented 2 years ago

@leveos, I think your email reply ate your attachment. Can you post it to the github issue directly?

here is the log file frome before. i will try the fresh install of the .zip now as well

printer2.local-1647380846568.log e

leveos commented 2 years ago

here is the console log fro the fresh install using the .zip printer4.local-1647390376697.log

smartin015 commented 2 years ago

Thanks @leveos - that second zip is super helpful. Seems like octoprint is trying to load the tab before the plugin is initialized for some reason. I'm digging in now to see why that's happening.

Specifically:

packed_core.js?a56692ed:1281 Could not bind view model CPViewModel to target #tab_plugin_continuousprint : ReferenceError: Unable to process binding "sortable: function(){return {foreach:jobs,options:{handle:'.fa-grip-lines-vertical',onStart:$root.sortStart,onEnd:$root.sortEnd,onMove:$root.sortMove}} }"
Message: Unable to process binding "visible: function(){return queuesets().length > 0 }"
Message: queuesets is not defined
    at visible (eval at parseBindingsString (http://printer4.local/static/webassets/packed_libs.js?1fe9f29c:131:1741), <anonymous>:3:60)
    at update (http://printer4.local/static/webassets/packed_libs.js?1fe9f29c:133:12908)
    at a.$.l (http://printer4.local/static/webassets/packed_libs.js?1fe9f29c:132:379)
    at Function.yd (http://printer4.local/static/webassets/packed_libs.js?1fe9f29c:130:18286)
    at Function.zd (http://printer4.local/static/webassets/packed_libs.js?1fe9f29c:130:17972)
    at Function.ha (http://printer4.local/static/webassets/packed_libs.js?1fe9f29c:130:17808)
    at Object.a.o.a.$ (http://printer4.local/static/webassets/packed_libs.js?1fe9f29c:130:16560)
    at http://printer4.local/static/webassets/packed_libs.js?1fe9f29c:132:366
    at Object.D (http://printer4.local/static/webassets/packed_libs.js?1fe9f29c:129:2126)
    at p (http://printer4.local/static/webassets/packed_libs.js?1fe9f29c:131:4001)
(anonymous) @ packed_core.js?a56692ed:1281
<elided>
packed_core.js?a56692ed:1283 ... binding done
packed_core.js?a56692ed:1283 Application startup complete
packed_plugins.js?0bc93001:7853 [octoprint.plugins.continuousprint] onTabChange - #tab_plugin_continuousprint == undefined vs #tab_plugin_continuousprint
packed_plugins.js?0bc93001:7686 [octoprint.plugins.continuousprint] loading state...

(EDIT: Binding also happens before receiving data on my end - so that's not actually the problem. It's like the default empty list on init is getting replaced by something else...)

smartin015 commented 2 years ago

@leveos , can you confirm you're running OctoPrint v1.6.1 and a relatively recent version of your browser? (e.g. Chrome 99.0.4844.57)

leveos commented 2 years ago

octoprint 1.7.3 chrome 99.0.4844.74

smartin015 commented 2 years ago

Thanks - I still haven't been able to reproduce the errors you're seeing on my environment. It also looks like you're using a lot of additional plugins. Can you list what you have installed? Perhaps there's a conflict somewhere...

leveos commented 2 years ago

yes extra stuff i use: bed visualizer consolidate temp control continuous print custom background floating navbar GCODE system commands M73 progress Navbar temprature plugin PSU control tab order themeify

leveos commented 2 years ago

i could take a backup of my octopi instance and send it to you if that will help. then you could use it to restore one of yours

leveos commented 2 years ago

just a thought. i use PSU control, my pi stays on always and i power on my printer with a relay after that it connects to the printer. could the bug be caused by continuous print being loaded while the printer isnt connected?

smartin015 commented 2 years ago

Hah! It's the tab order plugin.

Normally (i.e. in a more "vanilla" flavored octoprint) the continuous print tab is hidden in a drop-down, and not displayed on page load. With TabOrder installed, it's loaded first-thing, which seems to tickle a particular initialization problem with KnockoutJS & the continuousprint plugin. I can now reproduce the problem with TabOrder installed. Whew. Now looking into a fix.

If it's not too much to ask, can you uninstall TabOrder on your instance and see if it loads? I'll work on a fix from my end, but I'd like to see if that at least mitigates the problem on your end.

leveos commented 2 years ago

will do that right now. i also have continuous print as my very first tab on page load as its the first thing i need to get started for work

leveos commented 2 years ago

ok with it uninstalled it still happens to be my first tab for some reason. maybe lingering settings. but it is allowing me to add files to the queue now. would still like to have tab order installed if possible in the future as i can use it to hide unwanted tabs. but this is good

smartin015 commented 2 years ago

will do that right now. i also have continuous print as my very first tab on page load as its the first thing i need to get started for work

That's really convenient. I think I'll adopt that workflow for my own setup... thanks for the inadvertent tip :)

ok with it uninstalled it still happens to be my first tab for some reason. maybe lingering settings. but it is allowing me to add files to the queue now. would still like to have tab order installed if possible in the future as i can use it to hide unwanted tabs. but this is good

Wacky. Agreed this isn't a great solution, but at least we know how to mitigate the problem and I can start fixing it for real now that I can reproduce it. I'll take a look tomorrow as it's getting a bit late tonight and I haven't been able to land on a "quick fix" in just a few minutes. Thanks again for all your help!

smartin015 commented 2 years ago

After some more debugging, it turns out there's two different projects called knockout-sortable, and that's causing the plugins to collide:

The TabOrder sortable implementation unfortunately doesn't support nesting, which is used now extensively in continuousprint to allow reordering of jobs and of their contained items. Otherwise, it'd be possible to just migrate to their dependency as a quick (but brittle) workaround.

I'm attempting to mutate the naming of the dependencies used in this plugin so that the naming differs, which should hopefully fix this.

smartin015 commented 2 years ago

Just merged in the rename, and I've experimentally verified it works with TabOrder also installed. @leveos - when you have a moment, please give it a try again (uninstall & reinstall 1.4.1) and let me know if it works for you.

L0rz commented 2 years ago

for me it works! and i dont use the TabOrder plugin but many other!

Thx for the fast support

leveos commented 2 years ago

Just merged in the rename, and I've experimentally verified it works with TabOrder also installed. @leveos - when you have a moment, please give it a try again (uninstall & reinstall 1.4.1) and let me know if it works for you.

@smartin015 I can confirm that it is working perfectly with tab order installed now. just set up a large queue i will update this if for some reason it doesn't move onto the second file but i see no issues as of now.

leveos commented 2 years ago

i just want to update you that continuous print is working flawlessly with my setup now.

I also want to add that i really appreciate the optomizations you have done. the plugin is much more responsive now to adding and removing items from the queue and the gui is much more compact so i can see more items at a glance.

Tiri1i1 commented 2 years ago

I am sadly still having issues with the queue going forward. I am using this with Klipper on my CR-30, with the following G-Code between prints (same as before) G28 X0 Y0 Z0 G91 ; Set relative for lift G0 Z10 F200 G90 ;back to absolute positioning G28 X0 Y0 Z0; home

The queue is showing up well on the Plugin tab, and it does start with the first model, however after it's finished it cannot continue to the 2nd one.

smartin015 commented 2 years ago

i just want to update you that continuous print is working flawlessly with my setup now.

I also want to add that i really appreciate the optomizations you have done. the plugin is much more responsive now to adding and removing items from the queue and the gui is much more compact so i can see more items at a glance.

Thanks @leveos, that really means a lot and encourages me to do more :) I'm going to bump the version to 1.4.2 and close out this bug now that we have multiple fixes confirmed.

I am sadly still having issues with the queue going forward. I am using this with Klipper on my CR-30, with the following G-Code between prints (same as before) G28 X0 Y0 Z0 G91 ; Set relative for lift G0 Z10 F200 G90 ;back to absolute positioning G28 X0 Y0 Z0; home

The queue is showing up well on the Plugin tab, and it does start with the first model, however after it's finished it cannot continue to the 2nd one.

Sorry your setup is still misbehaving @Tiri1i1 - can you please open a new bug report and complete all the steps in the template?

It's not busywork - it actually helps me root-cause faster with the system bundle and logs attached, and what you're reporting sounds like a different issue vs this one. Thanks!

leveos commented 2 years ago

Hi,

Sorry for the delay. I had to work my day job. I uninstalled version 1.4.1 and cleaned up data. Now reinstalled from the master.zip file from the URL you provided. But now there is no continuous print plugin at all.

Using another one of my printers that still has the 1.4.1 installed I pulled the data you asked for previously.

Sent from Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 for Windows

From: Scott @.> Sent: Tuesday, March 15, 2022 1:59 PM To: @.> Cc: @.>; @.> Subject: Re: [smartin015/continuousprint] Not Possible to add Items to Q (Issue #14)

Actually - just pushed some additional logging to try and make the problem more obvious. Can you please follow the .zip style instructions herehttps://github.com/smartin015/continuousprint#add-the-plugin to pull those changes, and try with that?

— Reply to this email directly, view it on GitHubhttps://github.com/smartin015/continuousprint/issues/14#issuecomment-1068467797, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AS2U63TG5ITIKSRW2IHF7JTVAD225ANCNFSM5QVQ3ZOA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub. You are receiving this because you were mentioned.Message ID: @.***>

smartin015 commented 2 years ago

Hey @leveos - this should have been fixed long ago. We're on version 2.1.1 in the main branch. If you're still having trouble, please fully uninstall the plugin and then install it again from the plugin manager (i.e. don't try to install via zip file).

If there's still problems, please open a new issue as the cause would probably be different at this point. Thanks!