Skip to content

Commit f0b74a8

Browse files
alphaqiuclaude
andcommitted
fix: make tag comparison order-insensitive in sync integration test
Tags may be returned from database in different order than inserted. Sort both tag vectors before comparison to avoid flaky test failures. Co-Authored-By: Claude (glm-4.7) <noreply@anthropic.com>
1 parent f5a5bc4 commit f0b74a8

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

tests/sync_integration_test.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ async fn test_full_sync_flow_with_passkey() {
113113
assert_eq!(imported_record.record_type, test_record.record_type);
114114
assert_eq!(imported_record.encrypted_data, test_record.encrypted_data);
115115
assert_eq!(imported_record.nonce, test_record.nonce);
116-
assert_eq!(imported_record.tags, test_record.tags);
116+
// Tags may be in different order - sort before comparing
117+
let mut imported_tags = imported_record.tags.clone();
118+
let mut original_tags = test_record.tags.clone();
119+
imported_tags.sort();
120+
original_tags.sort();
121+
assert_eq!(imported_tags, original_tags);
117122

118123
// Step 9: Decrypt on device 2 to verify data integrity
119124
// In production, device 2 would derive its own device-specific key

0 commit comments

Comments
 (0)