Skip to content

Suggestion: add explicit block_cloud guard in run_cloud_print_job #41

@aries223

Description

@aries223

Background

block_cloud = 1 (the default) prevents the cloud MQTT connection from being established, which means Studio never marks the printer as cloud-online. Because of that, Studio always selects the pure LAN print path (start_local_print) and never calls start_print or start_local_print_with_record. Print files never reach Bambu's cloud.

The gap

run_cloud_print_job in src/cloud_print.cpp does not check block_cloud. If it were ever invoked while block_cloud = 1 — including when the user is logged in for profile sync — the function would pass its auth check and proceed to upload the print file to Bambu's S3 before anything could stop it.

The current protection is entirely behavioral: Studio won't call those paths because the printer is never cloud-online. There is no hard stop in the code itself.

Suggestion

Add an explicit guard at the top of run_cloud_print_job:

if (obn::config::current().block_cloud) {
    OBN_WARN("run_cloud_print_job: blocked by block_cloud");
    if (update_fn) update_fn(BBL::PrintingStageERROR,
                             BAMBU_NETWORK_ERR_INVALID_HANDLE,
                             "cloud print blocked by config");
    return BAMBU_NETWORK_ERR_INVALID_HANDLE;
}

This makes the guarantee explicit and independent of Studio's path-selection logic, so a future Studio update or unexpected code path can't accidentally route a print file through the cloud when the user has opted out.

This guard only affects print job delivery. Cloud login, profile sync, and model downloads are unaffected — they go through separate HTTP paths that block_cloud already intentionally leaves open.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions