mirror of
https://github.com/PR0M3TH3AN/SeedPass.git
synced 2025-09-09 15:58:48 +00:00
Add attempt_initial_sync and update sync logic
This commit is contained in:
@@ -47,7 +47,8 @@ def test_full_sync_roundtrip(dummy_nostr_client):
|
||||
manifest_id = relay.manifests[-1].id
|
||||
|
||||
# Manager B retrieves snapshot
|
||||
pm_b.sync_index_from_nostr_if_missing()
|
||||
result = pm_b.attempt_initial_sync()
|
||||
assert result is True
|
||||
entries = pm_b.entry_manager.list_entries()
|
||||
assert [e[1] for e in entries] == ["site1"]
|
||||
|
||||
|
@@ -47,7 +47,8 @@ def test_full_sync_roundtrip(dummy_nostr_client):
|
||||
manifest_id = relay.manifests[-1].id
|
||||
|
||||
# Manager B retrieves snapshot
|
||||
pm_b.sync_index_from_nostr_if_missing()
|
||||
result = pm_b.attempt_initial_sync()
|
||||
assert result is True
|
||||
entries = pm_b.entry_manager.list_entries()
|
||||
assert [e[1] for e in entries] == ["site1"]
|
||||
|
||||
|
@@ -81,6 +81,7 @@ def test_sync_index_missing_bad_data(monkeypatch, dummy_nostr_client):
|
||||
)
|
||||
monkeypatch.setattr(client, "fetch_deltas_since", lambda *_a, **_k: [])
|
||||
|
||||
pm.sync_index_from_nostr_if_missing()
|
||||
data = pm.vault.load_index()
|
||||
assert data["entries"] == {}
|
||||
result = pm.attempt_initial_sync()
|
||||
assert result is False
|
||||
index_path = dir_path / "seedpass_entries_db.json.enc"
|
||||
assert not index_path.exists()
|
||||
|
Reference in New Issue
Block a user