Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): show ⍰ as default value in case of missing variables in mustache templates #361

Conversation

nitram509
Copy link
Collaborator

Motivation

while developing and testing with Zeebe, the PostgreSQL DB sometimes is out of synch and makes Simple Monitor fall flat,
during rendering the mustache template. This includes the custom /error page, which is still a white page, even with all exception handlers in place.

This PR simply places a ⍰ character as default, so rendering passes through and just the special character is placed,
where the missing variable was used. This can look like this:
Screenshot 2022-01-26 at 15 10 32

I know this default value violates a bit the "fail fast" principle.
But I found it more annoying to analyze broken HTML/screenshots and search for exceptions in the log.
E.g. recently a field 'elementId' was not populated ... and its used multiple times - so the hunt for the broken template did start :/
This approach seems to be more indicative that some data might be corrupt - since this is a typical replacement character. .
So in summary I consider this default/replacement value a better solution over fail fast.

Any feedback is welcome.

@saig0 saig0 self-requested a review January 28, 2022 10:00
Copy link
Contributor

@saig0 saig0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nitram509 nice 🚀
This is a useful change. I like it 👍

@saig0 saig0 merged commit 352d884 into camunda-community-hub:master Jan 28, 2022
@nitram509 nitram509 deleted the feature-fallback-on-missing-variables-in-templates branch February 15, 2022 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants