I found what was triggering this behavior. I don't know about export, but upon restore/import, duplicates are removed from collections and history.
I made this python script to detect duplicates for both collections and history:
https://pastebin.com/UFK6e3JZFor my case, the code would return this:
Processing 'collections' section:
Total IDs in JSON using list (including duplicates): 1262
Total unique IDs in JSON using set (excluding duplicates): 1260
Total duplicate IDs: 1
Duplicate IDs and their counts (in order of appearance):
1. ID: AAAAAAAAAAAAAAAAAAAAAAAAAAAA, Count: 3
Processing 'history' section:
Total IDs in JSON using list (including duplicates): 1224
Total unique IDs in JSON using set (excluding duplicates): 1189
Total duplicate IDs: 34
Duplicate IDs and their counts (in order of appearance):
1. ID: 0000000000001, Count: 2
2. ID: 0000000000002, Count: 2
3. ID: 0000000000003, Count: 2
4. ID: 0000000000004, Count: 2
5. ID: 0000000000005, Count: 2
6. ID: 0000000000006, Count: 2
7. ID: 0000000000007, Count: 2
8. ID: 0000000000008, Count: 2
9. ID: 0000000000009, Count: 2
10. ID: 0000000000010, Count: 2
11. ID: 0000000000011, Count: 2
12. ID: 0000000000012, Count: 2
13. ID: 0000000000013, Count: 2
14. ID: 0000000000014, Count: 2
15. ID: 0000000000015, Count: 2
16. ID: 0000000000016, Count: 2
17. ID: 0000000000017, Count: 2
18. ID: 0000000000018, Count: 2
19. ID: 0000000000019, Count: 2
20. ID: 0000000000020, Count: 2
21. ID: 0000000000021, Count: 2
22. ID: 0000000000022, Count: 2
23. ID: 0000000000023, Count: 2
24. ID: 0000000000024, Count: 2
25. ID: 0000000000025, Count: 2
26. ID: 0000000000026, Count: 2
27. ID: 0000000000027, Count: 2
28. ID: 0000000000028, Count: 2
29. ID: 0000000000029, Count: 2
30. ID: 0000000000030, Count: 2
31. ID: 0000000000031, Count: 2
32. ID: 0000000000032, Count: 2
33. ID: 0000000000033, Count: 2
34. ID: 0000000000034, Count: 3
For collections I manually edited the json file to make one session show up for 3 times, to observe how collections duplicates would behave with restore/import.
For privacy reasons I edited the IDs.
Could you please add an option to keep the duplicates, as at times they are really useful as a reference for finding sessions in proximity that would have to deal with information related to the information in those duplicate sessions?