瀏覽代碼

[Fix] Remove incorrect "Lubricate Carbon Rods" maintenance task (#755)

  Carbon rods use plain bearings — lubricating them degrades print quality.
  Removed the lubrication task from defaults; only "Clean Carbon Rods"
  remains. Existing entries are auto-removed on next startup via
  ensure_default_types(). Updated wiki link mapping and tests.
maziggy 2 月之前
父節點
當前提交
dfb995bfe9

+ 1 - 0
CHANGELOG.md

@@ -18,6 +18,7 @@ All notable changes to Bambuddy will be documented in this file.
 - **Webhook Notifications Missing Camera Snapshot** ([#679](https://github.com/maziggy/bambuddy/issues/679)) — Webhook notification providers did not include camera snapshots (e.g. from First Layer Complete notifications), even though providers like Telegram, Pushover, ntfy, and Discord already attached them. The webhook payload now includes a base64-encoded `image` field when a snapshot is available (generic format only, not Slack format). Reported by @Arn0uDz.
 - **Mobile Sidebar Not Scrollable** — On mobile devices with many navigation items, the sidebar did not scroll, making bottom items unreachable. Added overflow scrolling to the nav section while keeping the logo and footer pinned.
 - **User Notification Ruff/Lint Fixes** ([#693](https://github.com/maziggy/bambuddy/pull/693)) — Fixed missing `timezone` import in email timestamp, unused lambda argument, PEP 8 blank line spacing for `mark_printer_stopped_by_user`, and SQLAlchemy forward reference in `UserEmailPreference` model.
+- **Carbon Rod Lubrication Maintenance Task Incorrect** ([#755](https://github.com/maziggy/bambuddy/issues/755)) — X1/P1 series printers showed a "Lubricate Carbon Rods" maintenance task, but carbon rods use plain bearings and should never be lubricated — doing so degrades print quality. Removed the lubrication task; only "Clean Carbon Rods" remains. Existing "Lubricate Carbon Rods" entries are automatically removed on next startup. Reported by @RosdasHH.
 - **Ntfy Notifications Fail With Non-ASCII Characters** ([#742](https://github.com/maziggy/bambuddy/issues/742)) — Ntfy notifications with camera snapshots failed when the printer name or filename contained non-ASCII characters (e.g. accented letters, CJK). The `Title` and `Message` HTTP headers were passed as Python strings, causing httpx to reject them with `UnicodeEncodeError`. Fixed by encoding header values as UTF-8 bytes, which ntfy handles correctly. Test notifications were unaffected because they use a hardcoded ASCII title and no image attachment. Reported by @user.
 
 ### Added

+ 2 - 7
backend/app/api/routes/maintenance.py

@@ -35,12 +35,8 @@ router = APIRouter(prefix="/maintenance", tags=["maintenance"])
 # Default maintenance types
 DEFAULT_MAINTENANCE_TYPES = [
     # Carbon rod models only (X1/P1)
-    {
-        "name": "Lubricate Carbon Rods",
-        "description": "Apply lubricant to carbon rods for smooth motion",
-        "default_interval_hours": 50.0,
-        "icon": "Droplet",
-    },
+    # Note: carbon rods must NOT be lubricated — they use plain bearings
+    # and lubrication degrades print quality. Only cleaning is offered.
     {
         "name": "Clean Carbon Rods",
         "description": "Wipe carbon rods with a dry cloth",
@@ -104,7 +100,6 @@ DEFAULT_MAINTENANCE_TYPES = [
 # "carbon" = X1/P1 series (carbon rods), "steel_rod" = P2S (steel rods),
 # "linear_rail" = A1/H2 series. Types not listed here apply to all printers.
 _ROD_TYPE_REQUIREMENTS: dict[str, str] = {
-    "Lubricate Carbon Rods": "carbon",
     "Clean Carbon Rods": "carbon",
     "Lubricate Steel Rods": "steel_rod",
     "Clean Steel Rods": "steel_rod",

+ 2 - 4
backend/tests/unit/test_maintenance_rod_filtering.py

@@ -11,16 +11,14 @@ class TestShouldApplyToPrinter:
     # Carbon rod tasks should only apply to X1/P1 models
     @pytest.mark.parametrize("model", ["X1C", "X1", "X1E", "P1P", "P1S"])
     def test_carbon_rod_tasks_apply_to_carbon_models(self, model: str):
-        assert _should_apply_to_printer("Lubricate Carbon Rods", model) is True
         assert _should_apply_to_printer("Clean Carbon Rods", model) is True
 
     def test_carbon_rod_tasks_do_not_apply_to_p2s(self):
         """P2S has steel rods, not carbon rods (#640)."""
-        assert _should_apply_to_printer("Lubricate Carbon Rods", "P2S") is False
         assert _should_apply_to_printer("Clean Carbon Rods", "P2S") is False
 
     def test_carbon_rod_tasks_do_not_apply_to_a1(self):
-        assert _should_apply_to_printer("Lubricate Carbon Rods", "A1") is False
+        assert _should_apply_to_printer("Clean Carbon Rods", "A1") is False
 
     # Steel rod tasks should only apply to P2S
     def test_steel_rod_tasks_apply_to_p2s(self):
@@ -51,6 +49,6 @@ class TestShouldApplyToPrinter:
 
     # Unknown models default to carbon (legacy behavior)
     def test_unknown_model_defaults_to_carbon(self):
-        assert _should_apply_to_printer("Lubricate Carbon Rods", "UNKNOWN") is True
+        assert _should_apply_to_printer("Clean Carbon Rods", "UNKNOWN") is True
         assert _should_apply_to_printer("Lubricate Steel Rods", "UNKNOWN") is False
         assert _should_apply_to_printer("Lubricate Linear Rails", "UNKNOWN") is False

+ 0 - 6
frontend/src/pages/MaintenancePage.tsx

@@ -141,12 +141,6 @@ function getMaintenanceWikiUrl(typeName: string, printerModel: string | null): s
   const isP2S = model.includes('P2S');
 
   switch (typeName) {
-    case 'Lubricate Carbon Rods':
-      // X1, P1 series have carbon rods
-      if (isX1) return 'https://wiki.bambulab.com/en/x1/maintenance/basic-maintenance';
-      if (isP1) return 'https://wiki.bambulab.com/en/p1/maintenance/p1p-maintenance';
-      return null;
-
     case 'Lubricate Steel Rods':
       // P2S has hardened steel rods
       if (isP2S) return 'https://wiki.bambulab.com/en/p2s/maintenance/lubricate-x-y-z-axis';