enonic / app-contentstudio

Content Studio of Enonic XP
GNU General Public License v3.0
10 stars 4 forks source link

404 / CS blocked / no server log when switching out an app with another version with different name / missing controller #3756

Open espen42 opened 3 years ago

espen42 commented 3 years ago

Narrow corner case, and obviously an error in code and content error, but how that error is caught and handled is confusing, badly reported, and crashes CS. This was done with react4xp, but I suppose it can be reproduced without it too:

I used the react4xp starter to make an app named test.starter.react4xp. Added a controller hello-react, which worked fine for some simple output on a site called hello.

Later, I kept the sandbox, wiped the project with an empty version of the same starter, but now:

I redeployed the app, the JAR got the same file name (but the app in it had a different key). In CS, I edited the hello site to update the app to the current one's app key: com.enonic.app.react4xp.

This caused 3 different issues:

image

Inspector, CS browse mode: image

Inspector, CS edit mode: image

espen42 commented 3 years ago

Content item data dump:

{
  "_id": "9fd76f22-d83d-4ff9-95ac-8bb929e4fd65",
  "_name": "hello",
  "_path": "/hello",
  "creator": "user:system:su",
  "modifier": "user:system:su",
  "createdTime": "2021-09-06T12:35:56.336930Z",
  "modifiedTime": "2021-09-06T15:02:54.462744Z",
  "owner": "user:system:su",
  "type": "portal:site",
  "displayName": "hello",
  "hasChildren": false,
  "valid": true,
  "childOrder": "modifiedtime DESC",
  "data": {
    "siteConfig": {
      "applicationKey": "com.enonic.app.react4xp",
      "config": {}
    }
  },
  "x": {},
  "page": {
    "type": "page",
    "path": "/",
    "descriptor": "test.starter.react4xp:hello-react",
    "config": {
      "greeting": "Hello",
      "greetee": "world",
      "things": "bottles of beer",
      "startCount": 42
    }
  },
  "attachments": {},
  "publish": {
    "from": "2021-09-06T15:02:59.357275Z",
    "first": "2021-09-06T15:02:59.357275Z"
  }
}
rymsha commented 2 years ago

404s are not logged as errors/warnings - it would be impractical. For me it looks like a cosmetics ContentStudio issue. @alansemenov

rymsha commented 2 years ago

jar file names don't matter for XP. If you replaced one jar with another and changed app name - it is the same as you removed old app and added new one.

site becomes broken because it references inexistent Page descriptor

In CS, I edited the hello site to update the app to the current one's app key: com.enonic.app.react4x

You ignored a red exclamation mark next to missing required app "test.starter.react4xp", you missed yellow warning about missing required app, you kept the page from missing app on the site. Perhaps - CS can give more/better contextual information - but this is not an XP bug