[MAGNOLIA-8710] $type: analyticsView doesn't work since Magnolia 6.2.27 Created: 03/Jan/23  Updated: 09/May/23  Resolved: 25/Jan/23

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: 6.2.27
Fix Version/s: 6.3.0, 6.2.28

Type: Bug Priority: Neutral
Reporter: Raphael Falvo Assignee: Adam Siska
Resolution: Fixed Votes: 1
Labels: None
Σ Remaining Estimate: Not Specified Remaining Estimate: Not Specified
Σ Time Spent: Not Specified Time Spent: Not Specified
Σ Original Estimate: Not Specified Original Estimate: Not Specified

Attachments: PNG File image-2023-01-10-15-04-58-675.png    
Issue Links:
causality
caused by MGNLUI-7125 Warning in logs: Encountered the '$ty... Closed
dependency
depends upon MGNLUI-7713 As developer I can use $type for an E... Closed
Sub-Tasks:
Key
Summary
Type
Status
Assignee
MAGNOLIA-8711 Implementation Sub-task Completed Daniel Alonso  
MAGNOLIA-8712 Refine implementation Sub-task Completed Adam Siska  
MAGNOLIA-8713 PI QA Sub-task Completed Adam Siska  
MAGNOLIA-8714 QA Sub-task Completed Adam Siska  
MAGNOLIA-8715 REVIEW Sub-task Completed Roman Kovařík  
MAGNOLIA-8716 Discovering/fixing failed test caused... Sub-task Completed Adam Siska  
MAGNOLIA-8717 Create ticket in ANALYTICS project to... Sub-task Completed Adam Siska  
MAGNOLIA-8719 Docu Sub-task Completed Adrian Brooks  
Template:
Acceptance criteria:
Empty
Task DoD:
[X]* Doc/release notes changes? Comment present?
[X]* Downstream builds green?
[X]* Solution information and context easily available?
[X]* Tests
[X]* FixVersion filled and not yet released
[X]  Architecture Decision Record (ADR)
Bug DoR:
[X]* Steps to reproduce, expected, and actual results filled
[X]* Affected version filled
Release notes required:
Yes
Documentation update required:
Yes
Date of First Response:
Epic Link: FieldsMaintenance
Sprint: Nucleus 28
Story Points: 2
Team: Nucleus
Work Started:

 Description   

Steps to reproduce

  1. Put any of these definitions or whole modules into Magnolia 6.2.27 webapp: https://git.magnolia-cms.com/plugins/servlet/search?q=analyticsView%20lang%3Ayaml
  2. You should see an error in logs 
Severity type:   MAJOR 
Title:           pages-app/subApps/browser/workbench/extensionViews/0/analytics: [Definition resolution] - Source data processing problem 
Problem details: No simple constructor found for type [interface info.magnolia.ui.ViewDefinition], null is returned
  1. The affected apps fail to start. with logs
Caused by: info.magnolia.objectfactory.MgnlInstantiationException: Failed to create an instance with c-tor [ContentViews(WorkbenchContext, ContentViewsDefinition, List)]
....
Caused by: java.lang.NullPointerException
	at info.magnolia.ui.contentapp.browser.ContentViews.lambda$new$0(ContentViews.java:89) ~[magnolia-ui-framework-6.2.27.jar:?]

Expected results

$type: analyticsView doesn't produce any definition problem and can be used

Actual results

$type: analyticsView doesn't produce definition problem and can't be used

Workaround

Replace

$type: analyticsView 

by 

class: info.magnolia.analytics.ui.app.view.extension.AnalyticsViewDefinition



 Comments   
Comment by Roman Kovařík [ 03/Jan/23 ]

Discovery:

This change might be also caused by this bug: https://git.magnolia-cms.com/projects/ADDON/repos/addon-nightly-webapp/commits/e5f8ed9235cdde6089b46185b5f82c41767066ff#magnolia-addon-config/src/main/resources/addon-config/decorations/pages-app/apps/pages-app.subApps.browser.workbench.yaml

Workaround/solution might be (to prevent changing all existing YAML definition in our and customers code base) introduction of

  • a new AnalyticsViewDefinition interface
  • alias annotation AnalyticsViewType bound to the interface above.
  • rename existing AnalyticsViewDefinition to ConfiguredAnalyticsViewDefinition with  analyticsView alias
Comment by Roman Kovařík [ 10/Jan/23 ]

My discovery theory might have a major flaw:

 Map of aliases stored as:

  • ContentViewDefinition.class: treeView, listView...
  • AnalyticsViewDefinition.class: analyticsView 
  • ...
      view: //this is a ViewDefinition.class
        $type: analyticsView //this will look only for aliases of ViewDefinition.class (which don't exist anymore, only for ContentViewDefinition.class), it never looks for AnalyticsViewDefinition.class aliases

With MGNLUI-7713, the implementation could change as follows:

  • AnalyticsViewDefinition: Replace @ViewType with @ExtensionViewType annotation ;
Generated at Mon Feb 12 04:35:06 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.