Explorar el Código

docs(backup): give the real reason cloud profiles are not restorable (#2656)

Both docstrings said the collector never writes `cloud_profiles/*.json`. That
was true when they were written and stopped being true at `455a9e4b` (#2717,
"collect cloud profiles from every connected account"), which is this
branch's rebase base — so the PR was shipping a stated reason its own base
had invalidated.

The real reason is the one the PR body now gives: restoring a preset means
writing to a Bambu or Orca Cloud account, which is a different operation from
every other category here. Those land in the local database, or on a printer
the instance already owns.

Checked that nothing in the restore path is confused by the new files — the
category globs don't reach `cloud_profiles/`, and it stays out of
`RestoreCategory`.
jmoore-skild hace 1 mes
padre
commit
733894aee6
Se han modificado 2 ficheros con 10 adiciones y 7 borrados
  1. 4 4
      backend/app/schemas/github_backup.py
  2. 6 3
      backend/app/services/github_restore.py

+ 4 - 4
backend/app/schemas/github_backup.py

@@ -218,10 +218,10 @@ REF_PATTERN = r"^(?:HEAD|[0-9a-fA-F]{7,40})$"
 class RestoreCategory(StrEnum):
     """Backup categories that can be restored.
 
-    Cloud profiles are deliberately absent: the backup collector never actually
-    writes ``cloud_profiles/*.json`` (it reads a "setting" list key the Bambu
-    Cloud API does not return), and the preset list it would collect carries no
-    setting payload to restore from. Tracked separately from #2656.
+    Cloud profiles are deliberately absent: restoring a preset means writing to
+    a Bambu or Orca Cloud account, which is a different operation from every
+    other category here — those land in the local database, or on a printer the
+    instance already owns. Tracked separately from #2656.
     """
 
     KPROFILES = "kprofiles"

+ 6 - 3
backend/app/services/github_restore.py

@@ -23,9 +23,12 @@ Design notes worth knowing before editing:
 * **Categories are applied archives -> spools -> settings -> kprofiles.**
   Archives first because spool usage history references ``archive_id``;
   K-profiles last because they leave the database and talk to hardware.
-* **Cloud profiles are not restorable.** The backup collector never actually
-  writes ``cloud_profiles/*.json``, and the preset list it would write carries
-  no setting payload. Tracked separately from #2656.
+* **Cloud profiles are not restorable.** Restoring a preset means writing to a
+  Bambu or Orca Cloud account, which is a different operation from everything
+  else here — every other category lands in the local database or, for
+  K-profiles, on a printer the instance already owns. Tracked separately from
+  #2656. (The collector does write ``cloud_profiles/*.json`` as of #2717; the
+  earlier claim that it did not is no longer true.)
 """
 
 import asyncio