-
Notifications
You must be signed in to change notification settings - Fork 186
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
TypeError resolved #4362
TypeError resolved #4362
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.
This PR does not solve the problem. Take into account that is error might be a symptom of something else, like the App not being properly mounted / unmounted, not an isolated error.
Also, be thorough on the explanation on the cause of the problems and the work done to solve it.
In this case, incompatibilities with the V8 engine on Chrome and Firefox browsers are pointed as the cause of the error, but not a single reference supporting this theory is provided.
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.
issue: the response
variable doesn't have the endpoint response directly when using WzRequest.genericReq
service, so it will not work as expected.
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.
- Code review: ✔️
- Test: ✔️
Note: check the changelog!
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.
CR ✅
Test ✅
|
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.3-7.16 4.3-7.16
# Navigate to the new working tree
cd .worktrees/backport-4.3-7.16
# Create a new branch
git switch --create backport-4362-to-4.3-7.16
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 44a43cbe28cf92824da60627b38ff50800474e07
# Push it to GitHub
git push --set-upstream origin backport-4362-to-4.3-7.16
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.3-7.16 Then, create a pull request where the |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-4.3-1.2-wzd 4.3-1.2-wzd
# Navigate to the new working tree
cd .worktrees/backport-4.3-1.2-wzd
# Create a new branch
git switch --create backport-4362-to-4.3-1.2-wzd
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 44a43cbe28cf92824da60627b38ff50800474e07
# Push it to GitHub
git push --set-upstream origin backport-4362-to-4.3-1.2-wzd
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-4.3-1.2-wzd Then, create a pull request where the |
* Solve TypeError * Add CHANGELOG * Change request service * Fix request's response structure (cherry picked from commit 44a43cb)
* Solve TypeError * Add CHANGELOG * Change request service * Fix request's response structure (cherry picked from commit 44a43cb)
Research
In
public/plugin.ts
a Get request is done with a Kibana resourcecore.http.get(/api/check-wazuh)
.That resource fails in Chrome and Firefox browsers.
The Kibana core get resource is set up to catch the error with an
HttpFetchError
class that is a child of the Node Error class. Which is compatible only with browsers with V8 engine.For this reason in Chrome it shows the error in the console as a debug and in Firefox it shows it in the console as an unrecognized error.
In the
http_fetch_errors.ts
andglobals.d.ts
files, kibana mentions V8 compatibility and that it will only work in browsers that use it. Attached screenshotshttps://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces
Proposed solution
Change the Get request that was made with a Kibana core.http.get(/api/check-wazuh) resource to the WzRequest.genericReq resource and it no longer fails, also add a test capture to public/plugin.ts that wraps the request and in case of failure, the error is detected when the browser does not work with the V8 engine.
Test
TypeError: NetworkError when attempting to fetch resource
videofirefox.mp4