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

feature: Debugging utilities + more user-friendly error listing #152

Merged
merged 12 commits into from
Nov 28, 2022

Conversation

tecc
Copy link
Member

@tecc tecc commented Nov 11, 2022

This PR introduces some more user-friendly debugging features that should help alleviate the need of opening issues here on the repository.
The main feature that is added is the debug page (or debug section of the settings page), which allows Notea to display issues it has detected whilst running. For example, if the server was configured improperly (say the store access key was not set), Notea will redirect you to the /debug page and tell you that the store configuration was not configured properly.

Due to its implementation in this PR, the feature will not work as well as it can when using serverless/function-based architectures (i.e. hosting on Vercel or similar services) instead of having a central server.
It is also very rudimentary - it currently only handles configuration-related problems (albeit it is very easy to add more issues), and is not translated.

TODO:

  • Detailed explanations for all currently handled issues
  • Proper handling for improper store configurations

@tecc tecc added the enhancement New feature or request label Nov 11, 2022
/debug: Added a /debug page that's only accessible if a fatal error in configuration has occurred.
settings: The settings page now includes a debugging section with similar content to the debug page. This still needs styling but is otherwise OK.
cause: Issue causes are now displayed if they're provided.
is-runtime: If an issue was discovered at runtime, they're prefixed with `Runtime` before the severity.
causes: Causes can now be error-like objects to provide more detail.
env-var: Setting the ALLOW_DEBUG environment variable to true allows you to access the debug page regardless of if an issue was detected.
store-config-debug: Previously, all store issues were reduced down to `Could not load configuration for store`. Now, along with that message, it provides more detailed messages for improperly configured credentials and more.
misc: Reworded a few things as well.
detailed-fixes: Fixes for more common issues are now provided by Notea. Some are still missing steps.
reformat: Simply reformatted using Prettier.
@tecc
Copy link
Member Author

tecc commented Nov 28, 2022

Right now, it's looking ready for merging. This is the current version of the /debug page, with some misconfigurations.
(You can view this for yourself over at https://notea-phy69jqq9-notea-org.vercel.app)
Screen Shot 2022-11-29 at 00 19 24

@tecc tecc marked this pull request as ready for review November 28, 2022 23:21
@tecc tecc merged commit 247b209 into main Nov 28, 2022
@tecc tecc deleted the feature/debugging branch November 28, 2022 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant