-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdevice_management.feature
More file actions
417 lines (367 loc) · 15.5 KB
/
Copy pathdevice_management.feature
File metadata and controls
417 lines (367 loc) · 15.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
# SPDX-FileCopyrightText: 2026 Mattia Egloff <mattia.egloff@pm.me>
#
# SPDX-License-Identifier: GPL-3.0-or-later
@device @multi-device
Feature: Device Management
As a Vauchi user
I want to use Vauchi on multiple devices
So that I can access and manage my contacts from any device
Background:
Given I have an existing identity on my primary device (Device A)
And my identity has been set up with display name "Alice"
# Device Linking
@link @implemented
Scenario: Generate device linking code
Given I am on Device A
When I go to Settings > Link New Device
Then a QR code should be displayed
And the QR code should contain encrypted linking data
And a numeric code should be shown as fallback
And the code should expire after 5 minutes
@link @implemented
Scenario: Link new device via QR code
Given Device A is showing a linking QR code
And I have Vauchi installed on Device B (new)
When I select "Link to Existing Identity" on Device B
And I scan the QR code from Device A
And Device A and B are in proximity
Then Device B should receive my identity
And Device B should sync all my data
And Device B should appear in my linked devices list
@link @implemented
Scenario: Link new device via numeric code
Given Device A is showing a linking code "123-456-789"
And I have Vauchi on Device B without camera
When I enter "123-456-789" on Device B
And I confirm the device fingerprint on Device A
Then Device B should be linked to my identity
And my data should sync to Device B
@link @implemented
Scenario: Linking requires proximity verification
Given Device A is showing a linking QR code
When someone scans it from a remote location
Then proximity verification should fail
And the device should not be linked
And a security warning should be shown on Device A
@link @implemented
Scenario: Maximum devices reached
Given I have 10 linked devices
When I try to link an 11th device
Then I should see "Maximum devices reached"
And I should be prompted to unlink a device first
# Device Synchronization
@sync @implemented
Scenario: New device receives full state
Given I have contacts and a contact card on Device A
When Device B is newly linked
Then Device B should receive my complete contact card
And Device B should receive all my contacts
And Device B should receive all visibility settings
@sync @implemented
Scenario: Changes sync between devices
Given Device A and Device B are linked
When I update my phone number on Device A
Then Device B should receive the update
And both devices should show the same phone number
@sync @implemented
Scenario: Bidirectional sync
Given Device A and Device B are linked
When I add a field on Device A
And I add a different field on Device B
Then both fields should appear on both devices
@sync @implemented
Scenario: Offline changes sync when reconnected
Given Device B is offline
When I make changes on Device A
And Device B comes back online
Then changes should sync to Device B
And both devices should be in sync
@sync @implemented
Scenario: Conflict resolution between devices
Given Device A and Device B are both offline
When I update my email to "a@test.com" on Device A
And I update my email to "b@test.com" on Device B
And both come online
Then the later change should win
And both devices should converge to the same value
# Viewing Linked Devices
@view @implemented
Scenario: View list of linked devices
Given I have 3 linked devices
When I go to Settings > Linked Devices
Then I should see all 3 devices listed
And each should show device name and type
And each should show last sync time
And the current device should be marked
@view @implemented
Scenario: View device details
Given I have linked "iPhone 15 Pro" as Device B
When I view details for Device B
Then I should see the device name "iPhone 15 Pro"
And I should see the device type "iOS"
And I should see when it was linked
And I should see last activity time
@view @implemented
Scenario: Rename a device
Given Device B is named "iPhone 15 Pro"
When I rename Device B to "Work Phone"
Then Device B should appear as "Work Phone"
And the name should sync to other devices
# Unlinking Devices
@unlink @implemented
Scenario: Unlink a device remotely
Given Device B is linked
When I select "Remove Device" for Device B on Device A
And I confirm the removal
Then Device B should be unlinked
And Device B should no longer receive updates
And Device B should be notified of removal
@unlink @planned
Scenario: Unlink current device
Given I am on Device B
When I select "Unlink This Device"
And I confirm
Then Device B should be unlinked
And Device B should return to initial setup
And my data should be removed from Device B
@unlink @implemented
Scenario: Unlinked device data wiped
Given Device B has been unlinked
Then all identity data should be deleted from Device B
And all contact data should be deleted
And Device B should show the welcome screen
@unlink @implemented
Scenario: Cannot unlink last device
Given Device A is my only linked device
When I try to unlink Device A
Then I should see "Cannot unlink your only device"
And unlinking should be prevented
# Device Security
@security @implemented
Scenario: Device-specific keys
Given Device A and Device B are linked
Then each device should have its own encryption key
And the device key should be derived from master seed
And compromise of one device key should not compromise others
@security @implemented
Scenario: Lost device revocation
Given Device B has been lost or stolen
When I mark Device B as "Lost" on Device A
Then Device B should be immediately unlinked
And Device B's device key should be revoked
And contacts should be notified if necessary
@security @implemented
Scenario: Verify device during linking
Given I am linking Device B
Then Device A should display Device B's fingerprint
And Device B should display Device A's fingerprint
And I should confirm they match before completing
@security @implemented
Scenario: Prevent unauthorized device linking
Given an attacker has access to a linking QR code
But the attacker is not physically present
Then proximity verification should block the attack
And the device should not be linked
# Platform Support
@platform @planned
Scenario Outline: Link devices across platforms
Given I have Device A running <platform_a>
When I link Device B running <platform_b>
Then linking should succeed
And sync should work between platforms
Examples:
| platform_a | platform_b |
| iOS | Android |
| iOS | macOS |
| iOS | Windows |
| iOS | Linux |
| Android | macOS |
| Android | Windows |
| macOS | Windows |
@platform @desktop @planned
Scenario: Desktop device without camera uses code
Given Device B is a desktop without camera
When I try to link Device B
Then I should be offered numeric code entry
And I should be able to type the code from Device A
# Device-Specific Settings
@settings @planned
Scenario: Device-specific notification settings
Given I have Device A and Device B linked
When I disable notifications on Device A
Then notifications should be off on Device A
But notifications should remain on for Device B
@settings @planned
Scenario: Device-specific sync settings
Given I have Device A (mobile) and Device B (desktop)
When I set "WiFi only sync" on Device A
Then Device A should respect WiFi-only
But Device B should sync on any connection
@settings @implemented
Scenario: Some settings sync across devices
Given I update my display name on Device A
Then the display name should sync to Device B
And visibility rules should sync to Device B
And contact groups should sync to Device B
# Activity Monitoring
@activity @planned
Scenario: View device activity
Given I have multiple linked devices
When I view device activity
Then I should see which device made recent changes
And I should see timestamps of activity
And I should see types of activity (sync, exchange, etc.)
@activity @planned
Scenario: Suspicious device activity alert
Given Device B shows activity from unusual location
When the system detects the anomaly
Then I should be alerted on other devices
And I should be offered to review and potentially revoke Device B
# Recovery
@recovery @planned
Scenario: Recover using any linked device
Given I have Device A and Device B linked
And I lose Device A
When I set up new Device C
Then I should be able to link it using Device B
And Device C should receive all my data
@recovery @implemented
Scenario: Transfer primary device role
Given Device A is my primary device
When Device A is about to be replaced
Then I should be able to designate Device B as primary
And Device B should handle all primary device functions
# Race Condition Edge Cases (Added 2026-01-21)
@edge-case @race-condition @implemented
Scenario: Concurrent device linking attempts
Given Device A is showing a linking code
And Device B and Device C both scan it simultaneously
When both attempt to link at the same time
Then only one device should successfully link
And the other should receive "Linking code already used"
And no duplicate devices should be created
@edge-case @race-condition @implemented
Scenario: Concurrent link and revoke
Given Device B is linked
And Device A initiates revocation of Device B
And Device C attempts to link simultaneously
When both operations race
Then both operations should complete correctly
And device registry should remain consistent
And version should be incremented for each change
@edge-case @duplicate @implemented
Scenario: Link same device twice
Given Device B is already linked to my identity
When I attempt to link Device B again
Then I should see "Device already linked"
And no duplicate entry should be created
And no duplicate entry should be created in the device registry
And the existing sync session for Device B should be refreshed
@edge-case @version @implemented
Scenario: Device registry version tracking
Given I have linked devices
When I add a new device
Then the registry version should increment
When I revoke a device
Then the registry version should increment again
And version should enable sync conflict detection
@edge-case @interruption @implemented
Scenario: Interrupted initial sync
Given I am linking Device B to Device A
And the data transfer is 50% complete
When Device B loses internet connection
Then Device B should pause the process
And Device B should NOT show as a functional device in the registry
And the process should resume or restart cleanly when reconnected
@edge-case @storage @implemented
Scenario: Insufficient storage for sync
Given Device B has only 10MB of free space
And my identity data is 50MB
When I attempt to link Device B
Then the system should pre-check storage
And linking should be blocked with "Insufficient Storage" error
@edge-case @identity-collision @implemented
Scenario: Linking to a device that already has a different identity
Given Device B is already set up with identity "Bob"
When I try to link Device B to identity "Alice"
Then Device B must prompt: "Existing data will be wiped. Proceed?"
And "Bob's" data must be securely erased before "Alice's" data is synced
@edge-case @timezone @implemented
Scenario: Timezone change during sync
Given Device A is in London (UTC+0) and Device B is linked
When I travel to New York (UTC-5) and Device A updates its wall clock
And I edit a contact on Device A in New York
Then Device A should use a UTC-based timestamp for the sync
And Device B should correctly identify the New York edit as the "latest"
And the change should sync to Device B despite the 5-hour local time jump
@edge-case @clock-skew @implemented
Scenario: Backward clock jump (Clock Skew)
Given Device A's system clock is manually moved back by 1 hour
When I make a change to my profile
Then the sync engine should detect the backward jump
And it should increment the Logical Counter instead of using the regressed wall-clock time
And the change must still propagate as the "most recent" version to other devices
@edge-case @expiry @implemented
Scenario: Linking code ignores timezone
Given Device A generates a linking code in Tokyo (UTC+9)
And Device B is in Los Angeles (UTC-8)
When Device B scans the code within 5 minutes of real-world time
Then the linking should succeed
And the 5-minute expiry should be calculated using absolute UTC time, not local time
# Platform Edge Cases (dissolved from platform_edge_cases.feature 2026-03-17)
@platform-edge-case @ios @keychain @planned
Scenario: Keychain access after device restore on iOS
Given I restored my iPhone from backup
When I open Vauchi
Then keychain items should be accessible
# Or I should be prompted to restore from backup
And I should not be locked out of my identity
@platform-edge-case @cross-platform @upgrade @planned
Scenario: Handle app upgrade
Given I have data from version 1.0
When I upgrade to version 2.0
Then data migration should occur automatically
And no data should be lost
And the user should not need to reconfigure
@platform-edge-case @cross-platform @downgrade @planned
Scenario: Prevent data loss on downgrade
Given I accidentally downgraded to an older version
When the older version cannot read newer data format
Then a clear error should be shown
And I should be told to upgrade
And data should not be corrupted
@platform-edge-case @cross-platform @restore @planned
Scenario: Handle device migration
Given I am setting up a new device
When I restore from backup
Then my identity should be recoverable
And contacts should sync from relays
And the experience should be smooth
@platform-edge-case @android @storage @planned
Scenario: Handle scoped storage on Android 11+
Given I am on Android 11 or later
When I export my data
Then export should use proper storage APIs
And files should go to Downloads or app-specific directory
And I should be able to share the export
@platform-edge-case @android @split @planned
Scenario: Handle split APK installation on Android
Given the app was installed via split APKs (Play Store)
When I use native features (camera, crypto)
Then all required libraries should be present
And the app should not crash
And features should work correctly
@platform-edge-case @desktop @crash @planned
Scenario: Recovery after crash on desktop
Given the desktop app crashed unexpectedly
When I relaunch the app
Then the app should detect the previous crash
And it should offer to restore last state
And unsaved changes should be preserved if possible
@platform-edge-case @ios @handoff @planned
Scenario: Handoff between iOS devices
Given I am editing my card on iPhone
When I open Vauchi on my iPad
Then I should see option to continue on iPad
And my changes should be available
And I should not lose unsaved work