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

Function "to" is accessing types wrong and does not work #32597

Closed
w33ble opened this issue Mar 6, 2019 · 2 comments
Closed

Function "to" is accessing types wrong and does not work #32597

w33ble opened this issue Mar 6, 2019 · 2 comments
Assignees
Labels
blocker bug Fixes for quality problems that affect the customer experience Feature:Canvas PR sent regression Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:Visualizations Visualization editors, elastic-charts and infrastructure v6.7.0 v7.0.0
Projects

Comments

@w33ble
Copy link
Contributor

w33ble commented Mar 6, 2019

Kibana version: 6.7+

Describe the bug:

When doing any casting with the to function, nothing works because the function tries to grab types from handlers, which is wrong. Types need to be accessed from @kbn/interpreter now.

So the value of types is undefined, and you end up with this error:

screenshot 2019-03-06 15 58 51

Steps to reproduce:

  1. Create an element that uses to with a server function, like demodata | to type="null"
@w33ble w33ble added bug Fixes for quality problems that affect the customer experience Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:Visualizations Visualization editors, elastic-charts and infrastructure canvasGA_0 labels Mar 6, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-canvas

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app

@w33ble w33ble self-assigned this Mar 7, 2019
@w33ble w33ble changed the title Server-side type casting does not work Function "to" is accessing types wrong and does not work Mar 7, 2019
@w33ble w33ble added the PR sent label Mar 7, 2019
w33ble added a commit that referenced this issue Mar 8, 2019
…unctions (#32600)

Closes #32356 

This PR fixes two issues.

The first there was an issue filed, #32356:

- Show non-Boom errors instead of asking users to look at server logs
  - Also write the error to the server when asking them to look there

### Before

![](https://user-images.githubusercontent.com/404731/53673728-9368b180-3c46-11e9-912e-7aaff25d3ddf.png)
*If the function failed for some reason, this is all you'd ever see*

### After

![screenshot 2019-03-06 16 24 09](https://user-images.githubusercontent.com/404731/53921029-4d3b9580-402c-11e9-85bf-21ab31e952bc.png)
*Errors are shown to the user*

![screenshot 2019-03-06 16 26 16](https://user-images.githubusercontent.com/404731/53921130-a0154d00-402c-11e9-9cb5-102d360a69f8.png)
*Code errors bubble up correctly as well*

---

The other I didn't bother opening an issue for:

- Fixes issue where functions that return `null` produce an error message
  - `null` is a valid thing to return, it's only `undefined` that causes a problem
  - This was only a problem for server functions that return `null` (currently, none of them do)
  - Introduced in #31298
  - Discovered when I ran into casting problems (see #32597)

### Before

![screenshot 2019-03-06 16 18 17](https://user-images.githubusercontent.com/404731/53921039-562c6700-402c-11e9-9650-fc51d1f91643.png)

### After

![screenshot 2019-03-06 16 19 01](https://user-images.githubusercontent.com/404731/53921044-5cbade80-402c-11e9-9cde-fdb49334dcd0.png)
w33ble added a commit to w33ble/kibana that referenced this issue Mar 8, 2019
…unctions (elastic#32600)

Closes elastic#32356 

This PR fixes two issues.

The first there was an issue filed, elastic#32356:

- Show non-Boom errors instead of asking users to look at server logs
  - Also write the error to the server when asking them to look there

### Before

![](https://user-images.githubusercontent.com/404731/53673728-9368b180-3c46-11e9-912e-7aaff25d3ddf.png)
*If the function failed for some reason, this is all you'd ever see*

### After

![screenshot 2019-03-06 16 24 09](https://user-images.githubusercontent.com/404731/53921029-4d3b9580-402c-11e9-85bf-21ab31e952bc.png)
*Errors are shown to the user*

![screenshot 2019-03-06 16 26 16](https://user-images.githubusercontent.com/404731/53921130-a0154d00-402c-11e9-9cb5-102d360a69f8.png)
*Code errors bubble up correctly as well*

---

The other I didn't bother opening an issue for:

- Fixes issue where functions that return `null` produce an error message
  - `null` is a valid thing to return, it's only `undefined` that causes a problem
  - This was only a problem for server functions that return `null` (currently, none of them do)
  - Introduced in elastic#31298
  - Discovered when I ran into casting problems (see elastic#32597)

### Before

![screenshot 2019-03-06 16 18 17](https://user-images.githubusercontent.com/404731/53921039-562c6700-402c-11e9-9650-fc51d1f91643.png)

### After

![screenshot 2019-03-06 16 19 01](https://user-images.githubusercontent.com/404731/53921044-5cbade80-402c-11e9-9cde-fdb49334dcd0.png)
w33ble added a commit to w33ble/kibana that referenced this issue Mar 8, 2019
…unctions (elastic#32600)

Closes elastic#32356

This PR fixes two issues.

The first there was an issue filed, elastic#32356:

- Show non-Boom errors instead of asking users to look at server logs
  - Also write the error to the server when asking them to look there

![](https://user-images.githubusercontent.com/404731/53673728-9368b180-3c46-11e9-912e-7aaff25d3ddf.png)
*If the function failed for some reason, this is all you'd ever see*

![screenshot 2019-03-06 16 24 09](https://user-images.githubusercontent.com/404731/53921029-4d3b9580-402c-11e9-85bf-21ab31e952bc.png)
*Errors are shown to the user*

![screenshot 2019-03-06 16 26 16](https://user-images.githubusercontent.com/404731/53921130-a0154d00-402c-11e9-9cb5-102d360a69f8.png)
*Code errors bubble up correctly as well*

---

The other I didn't bother opening an issue for:

- Fixes issue where functions that return `null` produce an error message
  - `null` is a valid thing to return, it's only `undefined` that causes a problem
  - This was only a problem for server functions that return `null` (currently, none of them do)
  - Introduced in elastic#31298
  - Discovered when I ran into casting problems (see elastic#32597)

![screenshot 2019-03-06 16 18 17](https://user-images.githubusercontent.com/404731/53921039-562c6700-402c-11e9-9650-fc51d1f91643.png)

![screenshot 2019-03-06 16 19 01](https://user-images.githubusercontent.com/404731/53921044-5cbade80-402c-11e9-9cde-fdb49334dcd0.png)
w33ble added a commit to w33ble/kibana that referenced this issue Mar 8, 2019
…unctions (elastic#32600)

Closes elastic#32356

This PR fixes two issues.

The first there was an issue filed, elastic#32356:

- Show non-Boom errors instead of asking users to look at server logs
  - Also write the error to the server when asking them to look there

![](https://user-images.githubusercontent.com/404731/53673728-9368b180-3c46-11e9-912e-7aaff25d3ddf.png)
*If the function failed for some reason, this is all you'd ever see*

![screenshot 2019-03-06 16 24 09](https://user-images.githubusercontent.com/404731/53921029-4d3b9580-402c-11e9-85bf-21ab31e952bc.png)
*Errors are shown to the user*

![screenshot 2019-03-06 16 26 16](https://user-images.githubusercontent.com/404731/53921130-a0154d00-402c-11e9-9cb5-102d360a69f8.png)
*Code errors bubble up correctly as well*

---

The other I didn't bother opening an issue for:

- Fixes issue where functions that return `null` produce an error message
  - `null` is a valid thing to return, it's only `undefined` that causes a problem
  - This was only a problem for server functions that return `null` (currently, none of them do)
  - Introduced in elastic#31298
  - Discovered when I ran into casting problems (see elastic#32597)

![screenshot 2019-03-06 16 18 17](https://user-images.githubusercontent.com/404731/53921039-562c6700-402c-11e9-9650-fc51d1f91643.png)

![screenshot 2019-03-06 16 19 01](https://user-images.githubusercontent.com/404731/53921044-5cbade80-402c-11e9-9cde-fdb49334dcd0.png)
w33ble added a commit that referenced this issue Mar 8, 2019
…unctions (#32600) (#32797)

Closes #32356

This PR fixes two issues.

The first there was an issue filed, #32356:

- Show non-Boom errors instead of asking users to look at server logs
  - Also write the error to the server when asking them to look there

![](https://user-images.githubusercontent.com/404731/53673728-9368b180-3c46-11e9-912e-7aaff25d3ddf.png)
*If the function failed for some reason, this is all you'd ever see*

![screenshot 2019-03-06 16 24 09](https://user-images.githubusercontent.com/404731/53921029-4d3b9580-402c-11e9-85bf-21ab31e952bc.png)
*Errors are shown to the user*

![screenshot 2019-03-06 16 26 16](https://user-images.githubusercontent.com/404731/53921130-a0154d00-402c-11e9-9cb5-102d360a69f8.png)
*Code errors bubble up correctly as well*

---

The other I didn't bother opening an issue for:

- Fixes issue where functions that return `null` produce an error message
  - `null` is a valid thing to return, it's only `undefined` that causes a problem
  - This was only a problem for server functions that return `null` (currently, none of them do)
  - Introduced in #31298
  - Discovered when I ran into casting problems (see #32597)

![screenshot 2019-03-06 16 18 17](https://user-images.githubusercontent.com/404731/53921039-562c6700-402c-11e9-9650-fc51d1f91643.png)

![screenshot 2019-03-06 16 19 01](https://user-images.githubusercontent.com/404731/53921044-5cbade80-402c-11e9-9cde-fdb49334dcd0.png)
w33ble added a commit that referenced this issue Mar 8, 2019
…unctions (#32600) (#32792)

Closes #32356 

This PR fixes two issues.

The first there was an issue filed, #32356:

- Show non-Boom errors instead of asking users to look at server logs
  - Also write the error to the server when asking them to look there

### Before

![](https://user-images.githubusercontent.com/404731/53673728-9368b180-3c46-11e9-912e-7aaff25d3ddf.png)
*If the function failed for some reason, this is all you'd ever see*

### After

![screenshot 2019-03-06 16 24 09](https://user-images.githubusercontent.com/404731/53921029-4d3b9580-402c-11e9-85bf-21ab31e952bc.png)
*Errors are shown to the user*

![screenshot 2019-03-06 16 26 16](https://user-images.githubusercontent.com/404731/53921130-a0154d00-402c-11e9-9cb5-102d360a69f8.png)
*Code errors bubble up correctly as well*

---

The other I didn't bother opening an issue for:

- Fixes issue where functions that return `null` produce an error message
  - `null` is a valid thing to return, it's only `undefined` that causes a problem
  - This was only a problem for server functions that return `null` (currently, none of them do)
  - Introduced in #31298
  - Discovered when I ran into casting problems (see #32597)

### Before

![screenshot 2019-03-06 16 18 17](https://user-images.githubusercontent.com/404731/53921039-562c6700-402c-11e9-9650-fc51d1f91643.png)

### After

![screenshot 2019-03-06 16 19 01](https://user-images.githubusercontent.com/404731/53921044-5cbade80-402c-11e9-9cde-fdb49334dcd0.png)
w33ble added a commit that referenced this issue Mar 8, 2019
…unctions (#32600) (#32794)

Closes #32356

This PR fixes two issues.

The first there was an issue filed, #32356:

- Show non-Boom errors instead of asking users to look at server logs
  - Also write the error to the server when asking them to look there

![](https://user-images.githubusercontent.com/404731/53673728-9368b180-3c46-11e9-912e-7aaff25d3ddf.png)
*If the function failed for some reason, this is all you'd ever see*

![screenshot 2019-03-06 16 24 09](https://user-images.githubusercontent.com/404731/53921029-4d3b9580-402c-11e9-85bf-21ab31e952bc.png)
*Errors are shown to the user*

![screenshot 2019-03-06 16 26 16](https://user-images.githubusercontent.com/404731/53921130-a0154d00-402c-11e9-9cb5-102d360a69f8.png)
*Code errors bubble up correctly as well*

---

The other I didn't bother opening an issue for:

- Fixes issue where functions that return `null` produce an error message
  - `null` is a valid thing to return, it's only `undefined` that causes a problem
  - This was only a problem for server functions that return `null` (currently, none of them do)
  - Introduced in #31298
  - Discovered when I ran into casting problems (see #32597)

![screenshot 2019-03-06 16 18 17](https://user-images.githubusercontent.com/404731/53921039-562c6700-402c-11e9-9650-fc51d1f91643.png)

![screenshot 2019-03-06 16 19 01](https://user-images.githubusercontent.com/404731/53921044-5cbade80-402c-11e9-9cde-fdb49334dcd0.png)
@kibanamachine kibanamachine added this to Inbox in Canvas Apr 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker bug Fixes for quality problems that affect the customer experience Feature:Canvas PR sent regression Team:Presentation Presentation Team for Dashboard, Input Controls, and Canvas Team:Visualizations Visualization editors, elastic-charts and infrastructure v6.7.0 v7.0.0
Projects
No open projects
Canvas
  
Inbox
Development

No branches or pull requests

3 participants