Bug 469347

Summary: Itinerary on Android mix up multiple ticket from the same file
Product: [Applications] KDE Itinerary Reporter: Gergely HORVÁTH <horvathg.1988>
Component: generalAssignee: Volker Krause <vkrause>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Android   
OS: Android 13.x   
Latest Commit: Version Fixed/Implemented In: 23.04.2
Sentry Crash Report:

Description Gergely HORVÁTH 2023-05-04 09:05:49 UTC
Hi there,

so I imported a ryanair pdf, that has two boarding passes inside. Itinerary recognizes it and imports both, from the drop down I can choose which boarding pass bar code to show, everything is perfect. I used import from file.

However, the name of the document is some weird long hash and when I click on it, system offers me to open the file with either Osmand (map), or KeePassXC (keychain program). No pdf reader. So I though, I just click Add document and add the pdf again so I can open it as well. It works, the pdf file appears with the proper name, I can open it. However from not on, I cannot switch between passengers, only the name changes, the corresponding data (barcode, sequence number, seat) does not. Also when I restart Itinerary, the name is also the same for both entry. This behaviour is the same even if I add the document again AND delete it after, the backend data seems to stay corrupt.

When I had multiple train tickets (Hungarian Railways, MÁV) for the same train and imported them one-by-one they were merged into a single entry (which is quite nice), but after restart, only the first name was present, multiple times. It seems like the same situation.

Now the weird thing, is that I cannot reproduce it on desktop. It happens on Android, LineageOS 20, Itinerary installed from F-Droid, version: 23.04.0 2023-04-27

I gladly send the tickets if it helps, I just don't feel comfortable posting it in the bug tracker. I can send via mail or matrix.

Best regards,
Gergely
Comment 1 Volker Krause 2023-05-04 14:42:50 UTC
At least the filename bug for attached documents on Android should be fixed with https://invent.kde.org/pim/itinerary/-/commit/2c9c2d396f26a14dd603a93e0f35b1f9cf291688 (in 23.04.1).

For the merging issue, yes, the affected documents would be quite helpful, I can't reproduce with samples I have here. You can send those to me directly (vkrause@kde.org). Thank you!
Comment 2 Gergely HORVÁTH 2023-05-05 07:21:14 UTC
(In reply to Volker Krause from comment #1)
> At least the filename bug for attached documents on Android should be fixed
> with
> https://invent.kde.org/pim/itinerary/-/commit/
> 2c9c2d396f26a14dd603a93e0f35b1f9cf291688 (in 23.04.1).
> 
> For the merging issue, yes, the affected documents would be quite helpful, I
> can't reproduce with samples I have here. You can send those to me directly
> (vkrause@kde.org). Thank you!

I sent you the tickets via mail. The problem with those is the same: they do get merged, but the pdfs are named after some hash and cannot be opened, but if I attach the files again, the data gets corrupted.
Thanks for looking into it!
Best regards,
Gergely
Comment 3 Volker Krause 2023-05-09 15:30:37 UTC
Git commit a90d36abdc3ac1109279578528ebdcfe7d5e9408 by Volker Krause.
Committed on 09/05/2023 at 15:29.
Pushed by vkrause into branch 'release/23.04'.

Fix attaching documents on multi-traveler reservations

This was previously overwriting all subsequent reservations with the one
of the first traveler.
FIXED-IN: 23.04.2

M  +2    -2    src/app/applicationcontroller.cpp

https://invent.kde.org/pim/itinerary/commit/a90d36abdc3ac1109279578528ebdcfe7d5e9408
Comment 4 Volker Krause 2023-05-09 15:31:32 UTC
Thank you for the documents and the detailed information on how to reproduce this, that helped a lot! Since we had already fixed the problem with corrupted filenames during the initial import it became much harder to spot that attaching extra documents to a multi-traveler trip is what broke things here.
Comment 5 Gergely HORVÁTH 2023-05-09 17:28:32 UTC
I'm glad I could help!
Best regards,
Gergely