Bug 149170 - UI The "Document in use" dialog is not appearing anymore when opening from 'recent files menu'
Summary: UI The "Document in use" dialog is not appearing anymore when opening from 'r...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: framework (show other bugs)
Version:
(earliest affected)
7.4.0.0 alpha0+
Hardware: All All
: high major
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:7.4.0 target:7.5.0 target:7.4.0.2
Keywords: bibisected, bisected, regression
Depends on:
Blocks:
 
Reported: 2022-05-19 07:47 UTC by Gabor Kelemen (allotropia)
Modified: 2022-07-27 08:08 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Document in use dialog that is no longer visible (81.05 KB, image/png)
2022-05-19 07:47 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2022-05-19 07:47:32 UTC
Created attachment 180213 [details]
Document in use dialog that is no longer visible

When a file is open in MSO, it can not be opened from the LO Recent Files selector / Start Center.

1, Open a docx/xlsx file in LO, then close it, so it's added to the Recent Files
2, Open it in MSO
3, Try to open it from the LO start center or the Standard toolbars file selector dropdown

Until recently a dialog popped up, telling the file is in use and asking what to do: open Read-only, Notify, Open, Cancel.
Now this is not shown and the file does not open.

Bibisected to:

https://git.libreoffice.org/core/+/404c51f3664ffd4f7e2c1c8bb8a12ac70954fec2

author	Michael Stahl <michael.stahl@allotropia.de>	Mon Apr 25 14:53:33 2022 +0200
committer	Michael Stahl <michael.stahl@allotropia.de>	Tue Apr 26 10:39:31 2022 +0200

officecfg,unotools,framework,sfx2: store ReadOnly for recent docs
Comment 1 Gabor Kelemen (allotropia) 2022-05-19 07:48:05 UTC
Adding CC to: Michael Stahl
Comment 2 Rainer Bielefeld Retired 2022-05-19 11:37:08 UTC
REPRODUCIBL with Server Installation of Version: 7.4.0.0.alpha0+ (x64)  Build ID b871abad383583f02eb49c7e49aeae01f6941072
CPU threads: 12; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
LLocale: de-DE (de_DE); UI: en-US  |  Calc: CL  |  Auto Colibre Theme  |  Special devUserProfile and a little different test:

0. Save simple sample.xlsx form LibO 7.3.3. and close LibO
1. Open sample.xlsx in FreeOffice PlanMaker 2021 (rev F1036.1015) 32bit 
2. Launch above mentioned LiOP 7.4
3. From Start Center WIN dialog browse for "sample.xlsx" and try to open
   » Expected: Warning dialog "Document file 'sample.xlsx' is locked for
     editing ..."
4. Open document "read only", close again, quit LibO
5. Launch above mentioned LibO 7.4
3. Menu ˋFile → Recent Documents → sample.xlsxˊ
   » Expected: Warning dialog 
     Actually: File opens "read only" without warning.     😥

Was still ok with Installation of Version: 7.3.3.2 (x64) 
Build ID: d1d0ea68f081ee2800a922cac8f79445e4603348
Comment 3 Rainer Bielefeld Retired 2022-05-19 11:44:20 UTC
No obvious DUP found with "locked for editing by" Query <https://bugs.documentfoundation.org/buglist.cgi?cmdtype=dorem&remaction=run&namedcmd=DUPs149170&sharer_id=19321>
Comment 4 Gabor Kelemen (allotropia) 2022-05-20 10:41:36 UTC
Note: when an odt file is opened in another LO version, then opening it from Recent Files works.
Comment 5 Commit Notification 2022-05-24 18:39:06 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/4ec4dd04b1a0f2313edfeff3cb7818ee560c99c3

tdf#149170 sfx2: store IsOriginallyLoadedReadOnly() for recent files

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Michael Stahl (allotropia) 2022-05-25 09:20:01 UTC
the case with other LO has locked document should be fixed - i can't test Windows applications that do native file locking right now
Comment 7 Xisco Faulí 2022-05-26 10:31:33 UTC
The issue is still reproducible in

Version: 7.4.0.0.alpha1+ / LibreOffice Community
Build ID: b6e0ae1b1bad5e222e21bbb4b2a158c1fc6f9779
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

Steps:
1. With master ( version A), create a new document ( document X ), save it and close it ( back to the start center )
2. With another version ( version B ), open document X
3. With version A, open document X from the start center -> Dialog is prompted -> OK
4. With version B, modify document X and save
5. With version A, open document X from the start center -> Nothing happens -> NOK
Comment 8 Commit Notification 2022-05-27 18:27:59 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/34eea317c5929d640aa43477c737d26d6b700bdb

tdf#149170 framework,sfx2: don't add ReadOnly=false

It will be available in 7.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Gabor Kelemen (allotropia) 2022-06-30 10:34:27 UTC
I can not confirm the behavior from comment #7 

For me files open from recent list in start center with and RO dialog if 
- the odt is opened in SI-GUI 7.2 instance
- the docx is opened in Word 2016

One problem is still there: 
In the docx case pressing the Edit document button on the top Infobar pops up the 

Document in Use

This file has been locked by another user
(this looks like having a new dialog layout9

If the docx is already opened from the SI-GUI 7.2 instance, the text and dialog is a bit different:

Document in Use

Document file 'foo.docx' is locked for editing by yourself on a different system since 30.06.2022 12:19

dialog. Just like for the first opening action.

In 7.3 this opened the document in RO mode without popup.

Version: 7.5.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 51bfd4a3105e4a406dc8f220102520202a72150a
CPU threads: 14; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: en-US (hu_HU); UI: en-US
Calc: threaded
Comment 10 Commit Notification 2022-07-19 15:56:01 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a1ca68e91868df51a269682f7c3dac62a88a85ef

tdf#149170 sfx2: fix regression about spurious dialog

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Michael Stahl (allotropia) 2022-07-19 16:02:06 UTC
there was some problem that the document was not reloaded when switching from read-only to editable that was fixed by https://cgit.freedesktop.org/libreoffice/core/commit/?id=5b5fb5e9c0580ecb70cf65882865bdaf16498fa5 which introduced the behaviour that comment #9 mentions.

but then there was a pointless 2nd dialog if you click Cancel on the first one.

hope it's fixed now.
Comment 12 Commit Notification 2022-07-27 08:08:57 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/b1d54e724ae360a22e08ef20e83a81804ebfae21

tdf#149170 sfx2: fix regression about spurious dialog

It will be available in 7.4.0.2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.