Bug 342542 - scripted service child items appear under wrong parent when populating multiple parents simultaneously
Summary: scripted service child items appear under wrong parent when populating multip...
Status: RESOLVED WORKSFORME
Alias: None
Product: amarok
Classification: Applications
Component: Tools/Script Manager (other bugs)
Version First Reported In: 2.8-git
Platform: Other Linux
: NOR normal
Target Milestone: 2.9
Assignee: Amarok Bugs
URL: http://kde-apps.org/content/show.php?...
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-06 04:31 UTC by Be
Modified: 2022-11-16 05:16 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
debugging output when Amarok works as expected (10.36 KB, text/plain)
2015-01-06 04:33 UTC, Be
Details
debugging output when Amarok inserts child items under wrong parent (30.01 KB, text/plain)
2015-01-06 04:34 UTC, Be
Details
SoundCloud script used to generate attached debugging outputs (17.50 KB, application/x-xz)
2015-01-06 04:35 UTC, Be
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Be 2015-01-06 04:31:25 UTC
When there are only a few items at the top level of the hierarchy for a scripted service, Amarok automatically tries to populate them all simultaneously before they are expanded by the user. This ends up with child items appearing under the wrong parent, always the one displayed last in the collection browser (reversing the sorting order changes which parent they are inserted under). When a long list of items is inserted at the top level, Amarok waits until the user expands them to populate the level below. This generally works as expected. However, if the user expands multiple parents in rapid succession (before any of them finish downloading and processing their respective data), the same issue occurs.

It seems that Amarok assumes there is only one parent item being populated at a time, so it does not keep track of which parent item scripts insert child items under. Amarok does not keep track of which parent script.donePopulating() is executed for either. That is, when Amarok reaches script.donePopulating() for the first parent item, it will not let the script insert items under any of the other parents:

amarok: BEGIN: int AmarokScript::ScriptableServiceScript::donePopulating() const 
amarok:   BEGIN: void ScriptableServiceManager::donePopulating(const QString&, int) 
amarok:     Service name:  "SoundCloud" , parent id:  286 
amarok:     BEGIN: void Collections::ScriptableServiceCollection::donePopulating(int) 
amarok:       BEGIN: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() 
amarok:         [ScriptableServiceQueryMaker] there are  0  albums 
amarok:       END__: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() [Took: 0s] 
amarok:       BEGIN: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() 
amarok:         [ScriptableServiceQueryMaker] there are  0  albums 
amarok:       END__: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() [Took: 0s] 
amarok:       BEGIN: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() 
amarok:         [ScriptableServiceQueryMaker] there are  0  albums 
amarok:       END__: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() [Took: 0s] 
amarok:       BEGIN: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() 
amarok:         [ScriptableServiceQueryMaker] there are  0  albums 
amarok:       END__: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() [Took: 0s] 
amarok:       BEGIN: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() 
amarok:         [ScriptableServiceQueryMaker] there are  0  albums 
amarok:       END__: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() [Took: 0s] 
amarok:       BEGIN: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() 
amarok:         [ScriptableServiceQueryMaker] there are  9  albums 
amarok:       END__: void Collections::ScriptableServiceQueryMaker::slotScriptComplete() [Took: 0s] 
amarok:     END__: void Collections::ScriptableServiceCollection::donePopulating(int) [Took: 0s] 
amarok:   END__: void ScriptableServiceManager::donePopulating(const QString&, int) [Took: 0s] 
amarok: END__: int AmarokScript::ScriptableServiceScript::donePopulating() const [Took: 0.001s]

Reproducible: Always
Comment 1 Be 2015-01-06 04:33:07 UTC
Created attachment 90250 [details]
debugging output when Amarok works as expected

when searching for "Culprate" with the attached script
Comment 2 Be 2015-01-06 04:34:41 UTC
Created attachment 90251 [details]
debugging output when Amarok inserts child items under wrong parent

when searching for "Wildlight" with attached script
Comment 3 Be 2015-01-06 04:35:29 UTC
Created attachment 90252 [details]
SoundCloud script used to generate attached debugging outputs
Comment 4 Justin Zobel 2022-10-17 00:40:55 UTC
Thank you for reporting this bug in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "CONFIRMED" when replying. Thank you!
Comment 5 Bug Janitor Service 2022-11-01 05:05:16 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Bug Janitor Service 2022-11-16 05:16:44 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!