aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/test_drive_sync.py
diff options
context:
space:
mode:
authorChristophe Besson <cbesson@gmail.com>2026-10-10 16:29:20 +0200
committerChristophe Besson <cbesson@gmail.com>2026-10-10 16:29:20 +0200
commit7957fa686eb6e8cf57bcb62ff4e6d2785693030b (patch)
tree562195088fa40bc4db85193956bdd8aaf00e31f5 /packages/meshbay-hub/tests/test_drive_sync.py
parent24547e4efd3a45b36b3bea8c29cfc687230a6d3a (diff)
downloadmeshbay-7957fa686eb6e8cf57bcb62ff4e6d2785693030b.tar.gz
feat(android): back up WhatsApp's own chat backups, and its media if asked
A WhatsApp section takes WhatsApp's folder through the picker, sends its encrypted Databases and Backups (not the dated copies of earlier weeks) into <folder>/<account>-whatsapp, and names the restore set in the manifest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'packages/meshbay-hub/tests/test_drive_sync.py')
-rw-r--r--packages/meshbay-hub/tests/test_drive_sync.py26
1 files changed, 25 insertions, 1 deletions
diff --git a/packages/meshbay-hub/tests/test_drive_sync.py b/packages/meshbay-hub/tests/test_drive_sync.py
index 7fc35d2..342b310 100644
--- a/packages/meshbay-hub/tests/test_drive_sync.py
+++ b/packages/meshbay-hub/tests/test_drive_sync.py
@@ -73,7 +73,19 @@ fake.transport = {
},
};
const hubFetch = async () => ({ admin_id: 'u-bob', members: fake.members, invited: [] });
-win.meshbay = { driveSync: {
+fake.wa = { on: false };
+win.meshbay = { whatsappSync: {
+ status: async () => ({ ...fake.status, on: fake.wa.on, dir: 'Backups/bob-whatsapp',
+ folders: [{ id: 'wa', name: 'WhatsApp' }] }),
+ plan: async () => ({ items: [{ token: 'w1', name: 'msgstore.db.crypt14',
+ dir: 'Backups/bob-whatsapp/Databases', size: 8, edited: false }],
+ manifest: false }),
+ sent: async (token, dir, name) => { fake.log.push(['sent', token, dir, name]); return true; },
+ manifest: async () => ({ item: null }), manifestSent: async () => true,
+ completed: async () => { fake.log.push(['wa-completed']); return fake.status; },
+ failed: async (code) => { fake.log.push(['failed', code]); return true; },
+ keepAlive: async () => true,
+}, driveSync: {
status: async () => fake.status,
plan: async () => { fake.log.push(['plan']); return { items: fake.items, manifest: false }; },
manifest: async () => ({ item: null }),
@@ -148,6 +160,18 @@ def test_a_lasting_refusal_names_the_files_backup(tmp_path):
assert ["completed"] not in log
+def test_whatsapps_chats_go_into_their_own_folder_on_their_own_runner(tmp_path):
+ log = _run("""
+fake.wa.on = true;
+fake.items = [];
+m.startDriveSync(ctx);
+await m.runWhatsAppSync();
+""", tmp_path)
+ assert ["upload", "Backups/bob-whatsapp/Databases", "msgstore.db.crypt14"] in log
+ assert ["fetch", "/wasync/w1", "bytes=0-7"] in log
+ assert ["wa-completed"] in log
+
+
def test_the_backup_has_no_way_to_remove_anything_on_the_node():
for path in (SYNC, STATIC / "photo-sync.js"):
src = path.read_text(encoding="utf-8")