Crash on saving

Crash on saving - Improper saving when opening files from forum - Сообщения

#1 Опубликовано: 20.02.2018 05:33:48
MBe

MBe

2 сообщений из 21 понравились пользователям.

Группа: User

Hello to Everybody,

I just noted a strange behaviour of Smath, I am using release 99.6622 but I believe it is the same in other versions.
If you open a file on the fly (without downloading) from an external source (i.e.: Smath Forum) and then you make any change to it, when you close the file you are prompted with a request to save the file.
If you (improperly) answer "Yes", Smath crashes.
I think Smath is right in the sense that you shouldn't save to a read-only location, but for the sake of completeness, you might want to protect against improper use from inexperienced users...

Thanks for the attention
Marco
#2 Опубликовано: 20.02.2018 06:30:46
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

Grazie Marco

Bug confirmed (unhandled System.UnauthorizedAccessException).

Guess the right way is:
1) check for permissions
2) If permissions are denied, prompt the "save as" dialog;
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Опубликовано: 21.02.2018 03:51:39
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3733 понравились пользователям.

Группа: Super Administrator

Hello, Davide.

I've made some improvements to saving logic. Please could you check the same scenario with latest sources?
Unfortunately I'm unable to reproduce this issue.

Thanks in advance!
#4 Опубликовано: 21.02.2018 04:50:57
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

Hello Andrey,

Not fixed with your improvements. To reproduce simply mark a file as readonly from the system file properties before opening it with SS.

In my sandbox folder there is a possible solution
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
1 пользователям понравился этот пост
Andrey Ivashov 21.02.2018 16:29:00
#5 Опубликовано: 21.02.2018 12:01:26
Jean Giraud

Jean Giraud

983 сообщений из 6866 понравились пользователям.

Группа: User

Wrote

Hello to Everybody,

I just noted a strange behaviour of Smath, I am using release 99.6622 but I believe it is the same in other versions.
If you open a file on the fly (without downloading) from an external source (i.e.: Smath Forum) and then you make any change to it, when you close the file you are prompted with a request to save the file.
If you (improperly) answer "Yes", Smath crashes.
I think Smath is right in the sense that you shouldn't save to a read-only location, but for the sake of completeness, you might want to protect against improper use from inexperienced users...

Thanks for the attention
Marco



Hello Marco,

Superb description, the missing link is that if you save from open on the fly,
good thing Smath crashes ... What ! Yes What, how Smath knows where to save ?
Back to originator ... no way. Why not Save as ...
Have you tried copy/paste on new sheet => Save as in some addressed location ?

Jean

#6 Опубликовано: 21.02.2018 15:15:13
Davide Carpi

Davide Carpi

1416 сообщений из 2873 понравились пользователям.

Группа: Moderator

Wrote

Yes What, how Smath knows where to save ?
Back to originator ... no way. Why not Save as ...



This is not a big deal, the file downloaded for reading is stored in a temporary path and flushed when you close the browser, Smath knows the path and since is a temp folder can write in it . But the downloaded file it is set as read-only and can't be overwritten (this is not handled, hence the crash); best way from my point of view is to simply prompt the "save as" dialog that is opened on the default location; this it works on any read-only file, and you can still get an error messsage from the system if you try to overwrite the file from within the dialog.
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#7 Опубликовано: 21.02.2018 15:31:34
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3733 понравились пользователям.

Группа: Super Administrator

Thank you very much Davide!

I've taken your fix as a basis and extended it to support all possible places where saving to file may be called (i.e. desktop UI, silent mode, etc.). So, this is done now.

Best regards.
1 пользователям понравился этот пост
Davide Carpi 21.02.2018 15:33:00
#8 Опубликовано: 21.02.2018 16:29:06
Andrey Ivashov

Andrey Ivashov

2269 сообщений из 3733 понравились пользователям.

Группа: Super Administrator

FYI: Fix is a part of just released nightly build: https://en.smath.info/forum/yaf_postst12549_SMath-Studio-0-99-6626--21-February-2018.aspx
1 пользователям понравился этот пост
Davide Carpi 22.02.2018 20:39:00
  • Новые сообщения Новые сообщения
  • Нет новых сообщений Нет новых сообщений