Confirm reconnect pairings and add connection discovery settings

Setup now waits for both IndexedDB writes: the acceptor acknowledges its
write, a failure on either side is reported to both people, and the
proposer removes its copy if the acceptor could not save. Every session
that authenticates the paired device compares a check value derived from
the stored pairing, so a one-sided pairing (interrupted setup, or Turn off
reconnect on one device) is turned off on the other side too.

The tracker is chosen under Network settings > Connection discovery
(manual, default from VITE_TRACKER_URL, or custom), stored per browser and
editable during a session.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SchluffeandClaude Opus 5.5 committed 2026-10-21 00:30:04 +02:00
1 parent 3659956967
commit acba97a7e1
10 files changed
+309 -55

No files matched your search

+3 -2
View File
@@ -2,7 +2,8 @@
import { ref } from 'vue';
import TransferPanel from './TransferPanel.vue';
import type { SavedConnection, ConnectionUpdate } from '../lib/connections.ts';
const props = defineProps<{ connection: SavedConnection; loadTrust: (id: string) => Promise<SavedConnection> }>();
import type { ReconnectPairing } from '../lib/reconnect.ts';
const props = defineProps<{ connection: SavedConnection; loadTrust: (id: string) => Promise<SavedConnection>; saveReconnect: (id: string, reconnect: ReconnectPairing | null) => Promise<void> }>();
const emit = defineEmits<{
status: [id: string, state: 'ready' | 'connecting' | 'connected'];
update: [id: string, change: ConnectionUpdate];
@@ -28,7 +29,7 @@ function navigate(next: 'send' | 'receive') {
<button :disabled="sessionActive && !connected" :class="{ active: (connected ? direction : mode) === 'send' }" :aria-pressed="(connected ? direction : mode) === 'send'" @click="navigate('send')">Send</button>
<button :disabled="sessionActive && !connected" :class="{ active: (connected ? direction : mode) === 'receive' }" :aria-pressed="(connected ? direction : mode) === 'receive'" @click="navigate('receive')">Receive</button>
</div>
<TransferPanel ref="panel" :key="mode" :sending="mode === 'send'" :connection="connection" :load-trust="() => loadTrust(connection.id)"
<TransferPanel ref="panel" :key="mode" :sending="mode === 'send'" :connection="connection" :load-trust="() => loadTrust(connection.id)" :save-reconnect="reconnect => saveReconnect(connection.id, reconnect)"
@session-change="sessionActive = $event; status()" @connected-change="connected = $event; direction = mode; status()"
@update="emit('update', connection.id, $event)" />
</div>