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/editor error logging #480
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for submitting this PR @jl-santana
Nice addition on the debounce logic!
We recently had one state variable to keep track of our Editor error states and that caused a few issues:
- If there are issues in multiple files (indexerFunction.js, schema, or type generation from schema), the user would only see one of these errors. So we made them explicit in order to show the full exhaustive list of errors. You can check out his PR here for more details or this issue
I think we should leave these as exhaustive even if they seem redundant as without it, its really difficult to track down which of the following is causing the issue (code, schema, typegeneration).
Open to hear about other suggestions on how to improve this!
@roshaans and I synced offline, tested the new flow, and found that using only one error state suffices for user communication. Additionally, the new flow prevents indexer registration in case of a schema error. I'll further test it on dev before deploying to prod. |
# Conflicts: # frontend/yarn.lock
That sounds worrisome since our client side schema validation often hasn't supported valid SQL features that we need in the schema (for example, |
@gabehamilton valid point, can we meet about this? |
@gabehamilton, @darunrs and I synced offline to discuss this issue.
|
More info about this can be found on this [issue](#483) Changes on this PR: - Validate code & schema before registering the indexer Logic: If formatting either the code or the schema fails, the `Publish` button is disabled. Only if type generation errors or no errors are detected, the `Publish` button will be enabled. More about this on this [discussion](#480 (comment)) https://github.com/near/queryapi/assets/15988846/68f89cb4-f561-4e8a-9fa7-81c1a38e548c Additionally - Created a reusable Modal with a global context to manage it, so we can trigger it from any component to display some info - Updated schema with granular error types for improved clarity - Created a custom error class to filter by type Error. We can add more fields on it if needed --------- Co-authored-by: Juan Luis Santana <juanluis@near.org> Co-authored-by: Roshaan Siddiqui <siddiqui.roshaan@gmail.com>
Changes Made:
Screen.Recording.2024-01-03.at.11.44.48.AM.mov