Skip to content

Add safeguards for 3MF post-processing scripts#1

Merged
mbv06 merged 3 commits into
mainfrom
uri-handler-safety-updates
May 20, 2026
Merged

Add safeguards for 3MF post-processing scripts#1
mbv06 merged 3 commits into
mainfrom
uri-handler-safety-updates

Conversation

@mbv06
Copy link
Copy Markdown
Owner

@mbv06 mbv06 commented May 20, 2026

Adds an optional safety check for downloaded 3MF files that contain embedded post-processing scripts.

By default, the bridge warns the user when scripts are found, records the detected script details in the log for inspection, and still opens the file in Bambu Studio. This check runs before launching Bambu Studio and only applies to downloaded .3mf files.

The behavior is configurable with post_process_action in config.toml:

  • warn: show a warning and continue opening the file
  • block: show an error and do not open Bambu Studio
  • ignore: skip this check

Additional URI handling fixes:

  • Treats empty bambustudioopen:/// callbacks from bambulab.com as no-op triggers, avoiding an invalid URI error during login flows.
  • Logs the original input URI when URI extraction fails, making malformed or empty callbacks easier to diagnose.

This also updates the README and changelog with the new behavior and configuration options.

mbv06 added 2 commits May 20, 2026 16:57
Ignore empty bambustudioopen URI triggers, log problematic input URIs during extraction failures, and bump the package version to 0.1.2.
@mbv06 mbv06 self-assigned this May 20, 2026
@mbv06
Copy link
Copy Markdown
Owner Author

mbv06 commented May 20, 2026

@codex

Copy link
Copy Markdown

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

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.

Reviewed commit: 99f5bcf180

ℹ️ 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 "@codex address that feedback".

Comment thread src/slicer_uri_bridge/cli.py Outdated
parser.add_argument(
"--version",
action="version",
version=f"%(prog)s {package_version('slicer-uri-bridge')}",
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 Badge Guard CLI version lookup when package metadata is absent

build_parser() now calls package_version('slicer-uri-bridge') unconditionally while constructing the parser, so environments that run from source (for example PYTHONPATH=src or python -m slicer_uri_bridge before installation) raise importlib.metadata.PackageNotFoundError before argument parsing. This makes all CLI subcommands fail, not just --version, and breaks the documented module-entry fallback path; the lookup should be wrapped with a fallback version string instead of crashing parser creation.

Useful? React with 👍 / 👎.

@mbv06 mbv06 merged commit 1c5c23c into main May 20, 2026
4 checks passed
@mbv06 mbv06 deleted the uri-handler-safety-updates branch May 20, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant