Bug 119210 - Migration dialog displayed while Inserting a Field
Summary: Migration dialog displayed while Inserting a Field
Status: RESOLVED DUPLICATE of bug 119419
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.1.0.3 release
Hardware: All All
: high major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: bibisected, bisected, regression
Depends on:
Blocks: Fields Database-Firebird-Migration Database-Firebird-Migration-Dialog
  Show dependency treegraph
 
Reported: 2018-08-10 21:37 UTC by Harald Koester
Modified: 2019-08-02 09:05 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Quicktime screencapture video of Insert Field behaviour (17.38 MB, video/quicktime)
2018-08-22 16:05 UTC, Alex Thurgood
Details
2nd screen capture with LO6103 (14.31 MB, video/quicktime)
2018-08-22 16:11 UTC, Alex Thurgood
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Harald Koester 2018-08-10 21:37:11 UTC
This bug occurs with my used user profile with version 6.1.0. With versions 6.0.5 and 6.0.6 with the same profile the bug does not occur. Also with a new profile with 6.1.0 the bug does not occur. If needed I can provide my user profile in a personal mail. Furthermore the bug emerges only if the experimental features are enabled (Options > LibreOffice > Advanced).

Steps how I produced the bug:

[1] Open new text document.
[2] Insert Field: Insert > Field > More Fields… An error message is displayed: “The document contains embedded HSQL data, which is deprecated. Would you like to migrate to Firebird now?“ This message is nonsense here. Expected: No such message.
[3] Click “Yes” or “Later”. The message appears again.
[4] Click “Yes” or “Later” again. The message vanishes and the Fields dialogue is displayed.
Comment 1 Aron Budea 2018-08-11 00:40:46 UTC
Do you have any registered databases listed in Options / LibreOffice Base / Databases apart from the default Bibliography one?
Comment 2 Robert Großkopf 2018-08-11 06:09:08 UTC
Could confirm the buggy behavior.
- Set experimental features on
- Start Insert > Fields > More Fields
... and the migation-dialog for HSQLDB to Firebird appears.

There is one registered HSQLDB database for BaseDocumenter. So the dialog appears only one time. If I delete this registration the dialog doesn't appear. But note: More Fields > Databases isn't choosen at this time. Seems Writer wanted to start the database before somebody reaches this tab and will choose the database.

Tested with LO 6.1.0.3 on OpenSUSE 15, 64bit rpm Linux.
Comment 3 Xisco Faulí 2018-08-13 19:26:17 UTC
I'm not sure whether this is the expected behaviour or not. I will let Tamás decide... Keeping it as NEW for now...
Comment 4 Alex Thurgood 2018-08-22 14:08:28 UTC
(In reply to Xisco Faulí from comment #3)
> I'm not sure whether this is the expected behaviour or not. I will let Tamás
> decide... Keeping it as NEW for now...

I can not believe that this is the expected behaviour. Inserting a field via the insert field dialog could use any available non-DB linked field, so there is no reason why LO should be attempting to load and connect (and thereby start the FB migration assistant) an existing  HSQLDB ODB file.
Comment 5 Alex Thurgood 2018-08-22 14:08:57 UTC
*** Bug 119419 has been marked as a duplicate of this bug. ***
Comment 6 Alex Thurgood 2018-08-22 14:13:21 UTC
Note that, as per the duplicate bug 119419, if the user has 10 or 15 registered database sources, then each one gets polled in an attempt to connect to it, or migrate it, depending on the type of registered database source.
Comment 7 Aron Budea 2018-08-22 14:37:15 UTC
(In reply to Alex Thurgood from comment #6)
> Note that, as per the duplicate bug 119419, if the user has 10 or 15
> registered database sources, then each one gets polled in an attempt to
> connect to it, or migrate it, depending on the type of registered database
> source.
Can it be tested separately whether the registered databases get polled or not? (is there any other indication of that)
Comment 8 Robert Großkopf 2018-08-22 15:37:28 UTC
(In reply to Aron Budea from comment #7)
> (In reply to Alex Thurgood from comment #6)
> > Note that, as per the duplicate bug 119419, if the user has 10 or 15
> > registered database sources, then each one gets polled in an attempt to
> > connect to it, or migrate it, depending on the type of registered database
> > source.
> Can it be tested separately whether the registered databases get polled or
> not? (is there any other indication of that)

Problem seems to be: Nobody recognized this. Only the migration-dialog to Firebird appears for every registered internal HSQLDB.
It couldn't be every database is connected, because the dialog for connecting to an external database with username and password doesn't appear.

If every internal HSQLDB would be opened while inserting a field in Writer it must slow down Writer without any reason of usability.
Comment 9 Alex Thurgood 2018-08-22 15:56:06 UTC
(In reply to robert from comment #8)


> Problem seems to be: Nobody recognized this. Only the migration-dialog to
> Firebird appears for every registered internal HSQLDB.
> It couldn't be every database is connected, because the dialog for
> connecting to an external database with username and password doesn't appear.
> 

Yes, I'm afraid it does as I mentioned in bug 119419.

I get a dialog for every database source requiring a ID/PWD combo authentication, irrespective of the db engine involved (pg, mysql).
Comment 10 Alex Thurgood 2018-08-22 16:05:21 UTC
Created attachment 144372 [details]
Quicktime screencapture video of Insert Field behaviour

Watch the video and notice how the registered databases get polled / attempted to be connected to, including any password dialogs (e.g. for mysql datasources)
Comment 11 Alex Thurgood 2018-08-22 16:06:27 UTC
Obviously, the db sources that don't require authentication don't display an ID/PWD entry dialog.
Comment 12 Alex Thurgood 2018-08-22 16:08:36 UTC
That first video was made using my LO62alpha build.
Comment 13 Alex Thurgood 2018-08-22 16:11:59 UTC
Created attachment 144373 [details]
2nd screen capture with LO6103

This screen capture was made with LO6103 where I have even more registered databases.
Comment 14 Xisco Faulí 2018-08-25 15:00:37 UTC
Regression introduced by:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=1c5c9b84df270e41c68e68bb69fbf183fc20eed2

author	Tamas Bunth <tamas.bunth@collabora.co.uk>	2018-04-23 22:05:55 +0200
committer	Tamás Bunth <btomi96@gmail.com>	2018-05-05 11:10:07 +0200
commit 1c5c9b84df270e41c68e68bb69fbf183fc20eed2 (patch)
tree 10a9dd4f2888224dd776a8ed4703e5fd91f201e4
parent 60413c9800c27f53c1108015b50754b065bc98c6 (diff)
Refactor: migration warn dlg without modifying API
Use Migration warn dialog directly in library dba instead of popping up
window in dbu and passing down the information through XDataSource.

Bisected with: bibisect-linux64-6.1

Adding Cc: to Tamas Bunth
Comment 15 Robert Großkopf 2018-08-25 17:24:43 UTC
(In reply to Xisco Faulí from comment #14)
> Regression introduced by:
> 
> https://cgit.freedesktop.org/libreoffice/core/commit/
> ?id=1c5c9b84df270e41c68e68bb69fbf183fc20eed2
> 
> author	Tamas Bunth <tamas.bunth@collabora.co.uk>	2018-04-23 22:05:55 +0200

That's the wrong regression! That is the introducing of the dialog for migration from internal HSQLDB to internal Firebird. Alex' attachments show: There also appear dialogs for opening other databases with password, which aren't internal databases.

The dialog is the hint for a wrong behaviour of Writer. The databases shouldn't be opened when you go to
Insert > Field > More Fields

"More Fields" doesn't need opening of all databases which are registered in LibreOffice. It will need to open a database when switching to this special database to see, which fields are in this database and should connected to my Writer document.

The migration-dialog should warn the user before migrating to Firebird. Without this dialog the databases would be migrated in the backgrund and the user won't know why there is a Firebird-database instead of HSQLDB and why some functions aren't working any more.
Comment 16 Xisco Faulí 2018-08-25 17:54:31 UTC
No, that's not correct. the migration dialog was introduced in 5b0ceb86c342754d8f4e83408c7ae0da0e3931d3, where the problem with insert field is not happening. Later, it was changed to avoid using the API in 1c5c9b84df270e41c68e68bb69fbf183fc20eed2, where the problem with the insert field was introduced as well...
Comment 17 Robert Großkopf 2018-08-25 18:37:13 UTC
Don't know why I could reproduce the buggy behaviour with
Version: 6.0.5.2
Build-ID: 54c8cbb85f300ac59db32fe8a675ff7683cd5a16
CPU-Threads: 6; BS: Linux 4.12; UI-Render: Standard; VCL: kde4; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

here. I have registered a MariaDB and were asked to input my password when 
Insert > Fields > More Fields

Also with LO 6.0.3 and also with LO 6.0.0.1.

The last version which worked correct here is 
Version: 5.4.6.2
Build-ID: 4014ce260a04f1026ba855d3b8d91541c224eab8
CPU-Threads: 6; BS: Linux 4.12; UI-Render: Standard; VCL: kde4; 
Gebietsschema: de-DE (de_DE.UTF-8); Calc: group

The problem isn't the migration dialog. The problem is Writer opens the databases when switching to Insert > Fields > More Fields since LO 6.0. The migration dialog shows this, the dialog for password of a database shows it also.

LO 6.0.0.1 was published in end of January 2018, so the bug couldn't be introduced by a commit of April 2018.
Comment 18 Xisco Faulí 2018-08-25 18:49:40 UTC
> here. I have registered a MariaDB and were asked to input my password when 
> Insert > Fields > More Fields

The password dialog is not the migration dialog...
Comment 19 Robert Großkopf 2018-08-25 19:13:10 UTC
(In reply to Xisco Faulí from comment #18)
> > here. I have registered a MariaDB and were asked to input my password when 
> > Insert > Fields > More Fields
> 
> The password dialog is not the migration dialog...

You are right, but the migration-dialog isn't the problem. The problem is: Writer connects to all databases when switching Insert > Field > More Fields. And this happens since LO 6.0.0.1 - where the migration dialog wasn't there. The migration-dialog is only a index for this. Nobody detected it before, because there are no many people, who connect to external databases where passwords are required and open Insert > Field > More Fields. The reason for both is the same.
Comment 20 Robert Großkopf 2018-08-25 19:19:20 UTC
Should I write a new bug for the buggy behaviour Writer connects all registered databases when connecting through Start Insert > Fields > More Fields ? This is the reason for both, (appearing migration dialog and appearing password-dialog for external databases) but if it is necessary I will do.

Seem my English isn't good enough to explain the reason everybody understands it.
Comment 21 Tamas Bunth 2019-01-31 14:27:26 UTC
Hi,

(In reply to Robert Großkopf from comment #20)
> Should I write a new bug for the buggy behaviour Writer connects all
> registered databases when connecting through Start Insert > Fields > More
> Fields ? This is the reason for both, (appearing migration dialog and
> appearing password-dialog for external databases) but if it is necessary I
> will do.
> 
> Seem my English isn't good enough to explain the reason everybody
> understands it.

I agree with Robert. Probably (hopefully) it does not make sense that LibreOffice tries to connect to each and every registered database.

Moreover, I think that the appearance of the warning dialog is the correct behavior, because connecting to a registered database in writer should be an explicit decision of the user - and it indicates correctly, that something is going wrong on the writer side.

I think we should set this issue as "not a bug", and file a new bug report to the above problem.
Comment 22 Alex Thurgood 2019-01-31 14:42:33 UTC
(In reply to Tamas Bunth from comment #21)


> 
> I agree with Robert. Probably (hopefully) it does not make sense that
> LibreOffice tries to connect to each and every registered database.
> 

Indeed, just imagine the scenario where several local and remote database configurations are stored in various declared (LO registered) ODBs - if you happen to be offline, you will spend a very long time waiting for the cycle running in the background to return a result from polling the db, perhaps even causing LO to enter a race condition - I don't know whether or what the timeout might be for such polling code, but I guess it has to try and return something at some stage ?

WRT to the migration dialog, this should only be displayed if the registered database source being polled is a hsqldb embedded database.
Comment 23 Alex Thurgood 2019-01-31 14:43:48 UTC
(In reply to Tamas Bunth from comment #21)


> I think we should set this issue as "not a bug", and file a new bug report
> to the above problem.

This is bug 119419
Comment 24 Harald Koester 2019-02-01 10:33:25 UTC

*** This bug has been marked as a duplicate of bug 119419 ***