Przeglądaj źródła

Remove timestamps from GitHub backup files for cleaner diffs
- Remove created_at from backup_metadata.json
- Remove exported_at from K-profile files
- Remove exported_at from cloud profile files (filament, printer, process)
- Remove exported_at from app settings backup
- Git already tracks file modification history, so these were redundant
- Backups now only show changes in git diff when actual data changes

maziggy 3 miesięcy temu
rodzic
commit
18fbd9c156
2 zmienionych plików z 5 dodań i 8 usunięć
  1. 4 0
      CHANGELOG.md
  2. 1 8
      backend/app/services/github_backup.py

+ 4 - 0
CHANGELOG.md

@@ -130,6 +130,10 @@ All notable changes to Bambuddy will be documented in this file.
   - Both settings persist in localStorage
   - Tooltip shows full name on hover
 - **K-Profiles Backup Status** - Fixed GitHub backup settings showing incorrect printer connection count (e.g., "1/2 connected" when both printers are connected); now fetches status from API instead of relying on WebSocket cache
+- **GitHub Backup Timestamps** - Removed volatile timestamps from GitHub backup files so git diffs only show actual data changes
+
+### Maintenance
+- Upgraded vitest from 2.x to 3.x to resolve npm audit security vulnerabilities in dev dependencies
 
 ## [0.1.6b11] - 2026-01-22
 

+ 1 - 8
backend/app/services/github_backup.py

@@ -309,13 +309,11 @@ class GitHubBackupService:
         }
         """
         files: dict[str, dict | list] = {}
-        now = datetime.now(UTC)
 
-        # Metadata file
+        # Metadata file (no timestamps - git tracks file history)
         metadata = {
             "version": "1.0",
             "backup_type": "bambuddy_profiles",
-            "created_at": now.isoformat(),
             "contents": {
                 "kprofiles": config.backup_kprofiles,
                 "cloud_profiles": config.backup_cloud_profiles,
@@ -365,7 +363,6 @@ class GitHubBackupService:
                             "printer_name": printer.name,
                             "printer_serial": serial,
                             "nozzle_diameter": nozzle,
-                            "exported_at": datetime.now(UTC).isoformat(),
                             "profiles": [
                                 {
                                     "slot_id": p.slot_id,
@@ -425,21 +422,18 @@ class GitHubBackupService:
             if filament_settings:
                 files["cloud_profiles/filament.json"] = {
                     "version": "1.0",
-                    "exported_at": datetime.now(UTC).isoformat(),
                     "profiles": filament_settings,
                 }
 
             if printer_settings:
                 files["cloud_profiles/printer.json"] = {
                     "version": "1.0",
-                    "exported_at": datetime.now(UTC).isoformat(),
                     "profiles": printer_settings,
                 }
 
             if process_settings:
                 files["cloud_profiles/process.json"] = {
                     "version": "1.0",
-                    "exported_at": datetime.now(UTC).isoformat(),
                     "profiles": process_settings,
                 }
 
@@ -462,7 +456,6 @@ class GitHubBackupService:
 
         files["settings/app_settings.json"] = {
             "version": "1.0",
-            "exported_at": datetime.now(UTC).isoformat(),
             "settings": settings_data,
         }