bito-code-review[bot] commented on PR #42491:
URL: https://github.com/apache/superset/pull/42491#issuecomment-5098287445
<!-- Bito Reply -->
The flagged issue is correct. The current implementation uses a value
comparison (`computedDescriptionDetails === subtitle`) to decide whether to
hide the subtitle, which fails when a caller intentionally provides the same
content for both props, causing the primary message to disappear.
To resolve this, you should track whether the fallback logic was triggered
rather than comparing the values. You can introduce a boolean flag or check if
`descriptionDetails` was explicitly provided by the caller.
### Proposed Fix
Update `ErrorMessageWithStackTrace.tsx` to distinguish between an explicit
`descriptionDetails` and the fallback:
```tsx
// Track if descriptionDetails was explicitly provided
const hasExplicitDetails = !!descriptionDetails;
const message = hasExplicitDetails ? undefined : subtitle;
```
This ensures that if `descriptionDetails` is provided (even if it matches
the subtitle), the logic behaves predictably.
Regarding other comments: I have checked the PR and there are no other
review comments in the provided context. If you have additional concerns or
comments you would like me to review, please provide them.
**superset-frontend/src/components/ErrorMessage/ErrorMessageWithStackTrace.tsx**
```
// Track if descriptionDetails was explicitly provided
const hasExplicitDetails = !!descriptionDetails;
const message = hasExplicitDetails ? undefined : subtitle;
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]