Skip to content

Add printer host/port persistence for print jobs - #249

Merged
PedroBMR merged 1 commit into
mainfrom
codex/extend-print_jobs-table-for-printer_host/port
Sep 30, 2025
Merged

Add printer host/port persistence for print jobs#249
PedroBMR merged 1 commit into
mainfrom
codex/extend-print_jobs-table-for-printer_host/port

Conversation

@PedroBMR

Copy link
Copy Markdown
Owner

Summary

  • extend the print_jobs schema and data layer to store printer host/port information
  • propagate host/port through the job enqueue path and UI so TCP jobs retain their targets
  • add coverage for replaying TCP jobs to confirm the saved host/port are reused

Testing

  • pytest tests/test_printing_new.py -k tcp_job_replay_preserves_host_port (skipped: Pillow unavailable)
  • pytest tests/db/test_init_and_migrate.py::test_init_creates_expected_schema tests/test_db_store.py::test_print_job_lifecycle

https://chatgpt.com/codex/tasks/task_e_68dbfb73a65c832c9b741f5e92f36b68

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting

Comment thread db/migrations.py
Comment on lines 198 to 202
"printer_transport",
"printer_host",
"printer_port",
"media_settings",
"pending_at",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Migrating print_jobs drops existing printer metadata

Adding printer_host/printer_port to expected_print_job_columns causes _migration_1 to rebuild the print_jobs table for every existing database. The subsequent copy loop still only reinserts id, created_at, template_name, payload and status, so any pre‑existing jobs lose their printer_backend, printer_transport, media_settings and other fields. After upgrading, previously queued jobs can no longer be replayed with the correct printer configuration. Consider adding the new columns via ALTER TABLE or copying all columns when recreating the table to preserve existing data.

Useful? React with 👍 / 👎.

@PedroBMR
PedroBMR merged commit 91067f5 into main Sep 30, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant