[MGNLUI-5654] Browser is not refreshed after datasourceObservation.trigger() call if subapp has its own datasource Created: 06/Feb/20  Updated: 08/Mar/20  Resolved: 24/Feb/20

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2

Type: Bug Priority: Neutral
Reporter: Evzen Fochr Assignee: Michael Duerig
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File Screenshot 2020-02-21 at 14.45.31.png    
Issue Links:
Relates
relates to MGNLUI-5706 Restore global nature of the manual o... Closed
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:
Sprint: UI Framework 17
Story Points: 3

 Description   

If datasource is configured at app level, all works fine (actions get LocalManualDatasourceObservation) from app.

Problem:
If datasource is configured at subApp level, LocalManualDatasourceObservation is scoped to grid but actions don't get this instance.

Fix might be to change scope of LocalManualDatasourceObservation to SubAppScoped.



 Comments   
Comment by Michael Duerig [ 20/Feb/20 ]

I tried to reproduce this with the notification app by moving its data source from the app level to the sub-app level:

 @@ -2,12 +2,12 @@
 class: info.magnolia.ui.contentapp.configuration.ContentAppDescriptor
 icon: icon-notifications-app
 htmlCaption: true
-datasource:
-  class: info.magnolia.admincentral.apps.notifications.NotificationDataSourceDefinition
 subApps:
   browser:
     class: info.magnolia.admincentral.apps.notifications.view.NotificationBrowserDescriptor
     subAppClass: info.magnolia.admincentral.apps.notifications.view.NotificationBrowserSubApp
+    datasource:
+      class: info.magnolia.admincentral.apps.notifications.NotificationDataSourceDefinition
     closable: false
     icon: icon-notifications-app
     actions: &actions

 

However, even with this change the grid of the browser sub-app updates properly across all open UIs when notifications get deleted.

efochr, could you provide more detailed instructions how to reproduce?

Comment by Evzen Fochr [ 21/Feb/20 ]

I have spotted this behaviour while using external dams.

1. download addons bundle
2. set your credentials to S3
3. try add folder to a bucket

datasourceObservation.trigger(); do nothing and new folder is shown after manual refresh only

Comment by Michael Duerig [ 25/Feb/20 ]

Fixed by putting LocalManualDatasourceObservation into @SubAppScoped instead of @UiContextScoped.

Unit test: https://git.magnolia-cms.com/projects/PLATFORM/repos/ui/commits/18d6f74d3016bedabff495e6053ae8bac19b2f4d#magnolia-ui-framework/src/test/java/info/magnolia/ui/observation/LocalManualDatasourceObservationTest.java

Comment by Jesus Alonso [ 25/Feb/20 ]

I confirm it works. Thanks!

Generated at Mon Feb 12 09:28:43 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.