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

Editable in-progress & network jobs #101

Closed
smartin015 opened this issue Jul 16, 2022 · 4 comments
Closed

Editable in-progress & network jobs #101

smartin015 opened this issue Jul 16, 2022 · 4 comments
Labels
enhancement New feature or request

Comments

@smartin015
Copy link
Owner

Is your feature request related to a problem? Please describe.

I also noticed I can't edit the count of job that is printing while it it is printing - I am not sure the reason but if makes sense to me to be able to change how many are remaining even while printing (perhaps the one that is actively printing only lets you reduce it to 1 rather than 0).

@napter

Describe the solution you'd like

Allow edits to the job which do not affect the current print.

Additional context

#99

@smartin015 smartin015 added the enhancement New feature or request label Jul 16, 2022
@smartin015 smartin015 changed the title Editable in-progress jobs Editable in-progress & network jobs Aug 4, 2022
@smartin015
Copy link
Owner Author

Expanding this FR to also include editability of network queue jobs (easiest option would probably just be re-uploading a changed version)

@smartin015
Copy link
Owner Author

smartin015 commented Aug 25, 2022

Latest merged PR allows for editing in-progress local jobs. Looking more into editable network jobs, we'll need to support the following user journey:

A user...

  1. uploads two jobs to LAN queue
  2. edits one job, after a printer has acquired it and started printing one of the sets. When the printer finishes that print, it waits for the edit to be saved before continuing with the job (abort to next job after N hours of waiting)
  3. edits the other job, preventing it from being acquired by another printer.
  4. drags a set from the first job into the second job
  5. saves the second job.

Under the hood, this would look like:

  1. call /job/submit endpoint twice with job details. Job is packed into .gjob format, fileshare information is posted and the job registry appended
  2. call /job/edit which calls edit_job on LAN queue. This sets the draft bit on the job registry object, with the same behavior as with local queues.
  3. again, call /job/edit to flip the draft bit
  4. happens only in the UI, no server-side changes
  5. calls /job/edit, overwriting job manifest and posting new gjob (regardless if sets have changed, as manifest is included within .gjob)

Development steps:

  • Move gjob hash into manifest, then generate a UUID for LAN queue jobs (decouple job ID from gjob hash)
  • Add LAN queue logic to /job/mv and eliminate /job/submit (and the submission warning modal)
  • Add LAN queue logic to /job/edit, allowing for editable LAN jobs
  • Move white-box mutation of job/peer data out of peerprint, back into CPQ repository queue classes
  • Create shared tests based on AbstractQueue interface, plug them into local_test.py and lan_test.py to ensure consistent behavior.
  • Fix job download for lan queue
  • Validation on lan submit should be visible when exception thrown
  • LAN Job completion after edit blows away edits during printing. LAN queue getJob behavior should fetch the job by its ID to ensure freshness

Followup PR items:

  • Clear completion count when resetting job

UI changes

  • Fix the local queue job still visible when moved to another queue.
  • Match progress bar padding on right side (same as left side)
  • Get rid of stats toggle option

Testing steps:

  • Drag from local to LAN
  • Drag from LAN to local
  • Drag from LAN to LAN
  • Editing LAN while a printer is printing
  • Multi-select menu options all operational on LAN queues (including reset progress & download gjob)
  • Check no acquire lan job in draft form

@smartin015
Copy link
Owner Author

smartin015 commented Oct 13, 2022

Ok, only a couple items remain before I can consider this complete:

  • Add periodic file cleanup in ContinuousPrint folder to prevent space from running out
  • Unpack job into file manager (outside of continuous print) when transferring back to local queue (to ensure files exist locally)

@smartin015
Copy link
Owner Author

Okay, this is now rolled into the v2.1.0rc1 release. I'm going to close this out in favor of more specific issues for whatever errors may pop up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant