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

Error to generate blocks on complex input #4964

Closed
BreakingPanda opened this issue Jun 28, 2021 · 5 comments
Closed

Error to generate blocks on complex input #4964

BreakingPanda opened this issue Jun 28, 2021 · 5 comments
Labels
issue: bug Describes why the code or behaviour is wrong needs more info Waiting for developer response

Comments

@BreakingPanda
Copy link

I noted that Blockly does NOT render a complex combination of Join and Where. Example:

Join(',', Where(['A','B'], x => x != 'C')

Which Where block should returns a list of A and B and final result should become A,B. If I try to open blockly and set up blocks, it will fail and output render becomes Join(',',).

Expected to construct blocks accordingly and keep rendered expression identical to provided input.

P.S. I lodged #4891 but recieved no respond so I lodge a new one.

@BreakingPanda BreakingPanda added issue: triage Issues awaiting triage by a Blockly team member issue: bug Describes why the code or behaviour is wrong labels Jun 28, 2021
@BeksOmega
Copy link
Collaborator

Hello, thank you for filing this issue :D We definitely always want blocks to render correctly so this is something we want to get fixed. Could you provide some additional information to help us reproduce the issue?

Some things that would be helpful are:

  1. A picture of the bad behavior, so we can know if we've reproduce it correctly.
  2. Your block definitions, or a link to them (eg pastebin, github, etc).
  3. Any errors you're seeing in the browser console. If you're not sure how to open your browser's console you can google "how to open console" (it's a bit different for every browser).

I'm really sorry your previous issue didn't get a response :/ There has been a lot of internal stuff happening in the past few weeks, so that's probably what caused it to slip through the cracks. Once we have a bit more information hopefully we can get this sorted out!

Thank you again for filing this! --Beka

@BreakingPanda
Copy link
Author

BreakingPanda commented Jul 1, 2021

Hi Beka,
Thanks for replying. Here is another example to study the bug in more details:

Iif([NextAdhocInspection_FormAnswers::InspectionType]='PTSKININSP', 'Skin Inspection', Iif([NextAdhocInspection_FormAnswers::InspectionType]='PTSKINRINSP', 'Skin Reinspection', 'None'))

Which simply should return a string. It's a nested IIF and when blocks try to render, they fail to render nested IIF. In my console, I see no error but many warnings all as of No message string for %{BLAH_BLAH}.. Due to error in nested IIF in this example, my expression changes to iif([NextAdhocInspection_FormAnswers::InspectionType] == 'PTSKININSP', '', ).

And sadly we have no open repo in GitHub to share.

error

P.S. I'm using MS Edge browser.

@BeksOmega
Copy link
Collaborator

Hello,
I'm not sure that we'll be able to help unless we can see the block definitions :/ There are a lot of things that could be causing this issue. For example, the connection checks could be set up incorrectly, some mutators could be encountering an edge case, or maybe an invalid field value is getting assigned somewhere.

I totally get if your block definitions are internal and you're not allowed to share them. In that case, would you be able to create a minimal example (using different block definitions) that reproduces the problem? Before we can try to fix it, we really need to be able to reproduce the issue.

I really want to get this issue fixed! But we just need a bit more info first :/

Oh! and with regard to the No message string for... errors, you probably need to include a language file:

<script src="msg/js/en.js"></script>

Best =)
--Beka

@moniika moniika added this to the Bug Bash Backlog milestone Jul 7, 2021
@moniika moniika added needs more info Waiting for developer response and removed issue: triage Issues awaiting triage by a Blockly team member labels Jul 7, 2021
@moniika
Copy link
Contributor

moniika commented Jul 7, 2021

Blockly doesn't provide an API for generating blocks from an expression string.
This seems like it might be a bug outside of Blockly in the code where you construct the blocks from the expression string.

If it is in Blockly, then we can try to help you if you provide us a minimal reproduction sample, as Beka mentioned above, otherwise it's unclear what or where the problem is.
The only suggestion I can think of at the moment to help you with debugging is to look at where you load the Block into the Blockly workspace. I'm making a guess that you generate xml or json after parsing the expression string and load that. You could look at the generated xml/json and see if it is what you expect.

About the console warnings:
Beka's suggestion about the language file might solve your console warnings, or it might be another instance of an existing bug #4369

@BreakingPanda
Copy link
Author

Hi Beka and Moniika,
As Moniika made a good guess, I create a XML of blocks definitions and then load them into Blockly workspace. So if any of my blocks is wrong, Blockly crashes for me which is obvious.
As my code constructs those blocks, I had to deal with situation where user gives me invalid input. So a simple solution is to better error handle when call domToWorkspace(...).

Thanks for your help. I am closing this issue now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: bug Describes why the code or behaviour is wrong needs more info Waiting for developer response
Projects
None yet
Development

No branches or pull requests

3 participants