Bug 124918 - iOS App Crashes with Invalid Template URL
Summary: iOS App Crashes with Invalid Template URL
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: iOS (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other iOS
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-23 15:01 UTC by Andreas Gruhler
Modified: 2019-04-26 13:27 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andreas Gruhler 2019-04-23 15:01:11 UTC
Description:
If the template URL in the Collabora iOS-App settings is not valid, the app crashes without error message. The user does not know, what is wrong with the template location which was provided in the iOS-Settings. Please find video attached.

Steps to Reproduce:
1. Go to iOS Collabora template list url setting and choose a template URL that works: https://nicu.winebarrel.ch/tpl_de_ch/00_index.txt
2. Open Collabora iOS-App and create a template
3. Save and close the document created from the template
4. Choose a differente template URL (but same templates) in the iOS Collabora template list url setting: https://tpl.dev.base4kids2.ch/tpl_de_ch/00_index.txt
5. Open Collabora iOS-App and create a template

Actual Results:
1. The template url is saved in the settings
2. Collabora iOS-App opens and document can be created from a template
3. Document can be saved and closed
4. The second template url can be entered and saved in the settings
5. The Collabora iOS-App should open, since the template url contains exactly the same templates as the first url.

Expected Results:
1. The template url is saved in the settings
2. Collabora iOS-App opens and document can be created from a template
3. Document can be saved and closed
4. The second template url can be entered and saved in the settings
5. The Collabora iOS-App does not open (crash)


Reproducible: Always


User Profile Reset: No



Additional Info:
Tests with the first URL (https://nicu.winebarrel.ch/tpl_de_ch/00_index.txt) showed, that the iOS crashes when the template contains umlauts (ö,ä,ü) in the tepmlate name.

Tests with the second URL always led to a crash of the iOS-App, even though the URL provides the same templates (no umlauts in the template names).
Comment 1 Andreas Gruhler 2019-04-23 15:25:26 UTC
Video too big for upload, is on:
https://cloud.dev.base4kids2.ch/index.php/s/5SGqzPmjossRFiD
Comment 2 Andreas Gruhler 2019-04-24 09:18:24 UTC
We just discovered the problem about the second url, https://tpl.dev.base4kids2.ch/tpl_de_ch/00_index.txt, which is fixed by now:

There was an empty line at the end of the file, which lead to the crash. To summarize, index files cannot contain:
* empty lines
* umlauts (ä,ö,ü)
Comment 3 Tor Lillqvist 2019-04-26 07:36:54 UTC
It is btw not necessary to mention the thumbnails for the templates in the template list file. Just the template files. The names of the corresponding thumbnails are constructed automatically by appending .png.
Comment 4 Commit Notification 2019-04-26 09:05:35 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/online/+/4e2ad4d2bc018584c074d91b6d5927c5c2b905bf%5E%21

tdf#124918: Allow empty lines in the template list file
Comment 5 Commit Notification 2019-04-26 09:05:42 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/online/+/d550944053cca481e3bae1e981b16a23132c0126%5E%21

tdf#124918: More logging in template download error situations
Comment 6 Commit Notification 2019-04-26 09:05:50 UTC
Tor Lillqvist committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/online/+/db9208d36417490ea1a0a536c701233279a49e0d%5E%21

tdf#124918: Don't crash on invalid URLs in the template list file
Comment 7 Tor Lillqvist 2019-04-26 09:25:52 UTC
After the above commits (which are also present in the branch from which the iOS app is built for the customer), empty lines or invalid URLs in the file no longer crash the app.

About error messages, should they really be displayed to the user? The end user can't do anything about it anyway. Would it be better to just NSLog them, so that a support person can see them using whatever tool they use?
Comment 8 Andreas Gruhler 2019-04-26 13:22:35 UTC
(In reply to Tor Lillqvist from comment #3)
> It is btw not necessary to mention the thumbnails for the templates in the
> template list file. Just the template files. The names of the corresponding
> thumbnails are constructed automatically by appending .png.

Thank you for the tip, I did not know about this. Actually, is this setting for the template URL already documented somewhere?
Comment 9 Andreas Gruhler 2019-04-26 13:27:49 UTC
(In reply to Tor Lillqvist from comment #7)
> After the above commits (which are also present in the branch from which the
> iOS app is built for the customer), empty lines or invalid URLs in the file
> no longer crash the app.
> 
> About error messages, should they really be displayed to the user? The end
> user can't do anything about it anyway. Would it be better to just NSLog
> them, so that a support person can see them using whatever tool they use?

On one hand, as long as an end user is able to modify this setting through the UI and choose another template URL in the iOS-Settings, it makes sense to also provide her the error message in case something goes wrong (maybe in a simplified form).

On the other hand, if the template URL were a setting only accessible by an admin or super-user, I'd rather not show it to an end user.

In any case, writing the errors to NSlog can be helfpul.