Open Mearman opened 4 weeks ago
It's not that zealous, but it may be buggy. If you can include an example board I can see why it's failing.
I was thinking initially that to expose any glaring bugs, we could write a test that passes all of the serialised graphs through the loader function like I do with the Schema package.
Ok, @paullewis, I have a bit more info and an example.
{
"title": "Business Review Replier Demo",
"description": "A board to demonstrate the business review replier.",
"metadata": {
"comments": []
},
"edges": [
{
"from": "fn-29",
"to": "fn-31",
"out": "item",
"in": "b"
},
{
"from": "passthrough-30",
"to": "fn-31",
"out": "*",
"in": ""
}
],
"nodes": [
{
"id": "fn-29",
"type": "runJavascript",
"configuration": {
"array": [
"Rating: ★★★★★\n\nI recently visited a coffee shop and was thoroughly impressed with my experience. From the moment I walked in, I was greeted with a warm, welcoming atmosphere that instantly made me feel at home. The cosy decor, complete with comfortable seating and tasteful artwork, added to the overall charm of the place.\nThe staff were exceptionally friendly and attentive, making sure that every customer felt valued. I was particularly impressed by their knowledge of the menu and their willingness to offer recommendations. Their passion for coffee was evident, and it was clear that they took great pride in their work.\nNow, onto the coffee – it was nothing short of spectacular. I ordered a flat white, and it was perfectly balanced with a rich, creamy texture and a smooth, velvety finish. The barista’s skill in crafting the drink was apparent, and it was one of the best coffees I’ve had in a long time. They also offer a variety of specialty drinks, teas, and pastries, all of which looked delicious.\nOne aspect that really stood out was their commitment to sustainability. This coffee shop uses ethically sourced beans and environmentally friendly packaging, which is a big plus for me. It’s great to see a local business taking steps to reduce its environmental impact.\nOverall, the coffee shop exceeded my expectations in every way. The delightful ambience, excellent coffee, and outstanding service make it a standout in the local coffee scene. I highly recommend paying them a visit – you won’t be disappointed!",
"I had an amazing time at the café. The coffee was absolutely perfect and the staff were so friendly and attentive. I’ll definitely be coming back!\"",
"This boutique has such a fantastic collection! I found exactly what I was looking for and the customer service was excellent. Highly recommend!\"",
"What a wonderful experience at the spa! The massage was incredibly relaxing and the ambience was just right. Can't wait for my next visit.\"",
"The service at the restaurant was really slow. We had to wait almost an hour for our food, and when it arrived, it was cold and undercooked.\"",
"I was very disappointed with my stay at the hotel. The room was not clean, and the staff seemed uninterested in addressing our concerns.\"",
"The product I bought from the electronics store stopped working after just a week. When I tried to contact customer service, I got no response.\"",
"The new exhibit at the museum was interesting, but it felt a bit disorganised. Some of the information was hard to follow, but overall, it was a decent visit.\"",
"I had a mixed experience at the salon. The haircut was fine, but the stylist seemed rushed and didn't really listen to what I wanted.\"",
"Shopping at the supermarket is convenient, but the aisles are often cluttered and it’s hard to find certain items. Prices are reasonable though.\""
],
"code": "const fn_29 = inputs=>{console.log({inputs});const randomIndex=Math.floor(Math.random()*inputs.array.length);return{item:inputs.array[randomIndex]}};",
"name": "fn_29",
"raw": true
},
"metadata": {
"title": "Pick random example",
"visual": {
"x": 213,
"y": 0,
"collapsed": false
}
}
},
{
"id": "fn-31",
"type": "runJavascript",
"configuration": {
"code": "const fn_31 = inputs=>{if(\"a\"in inputs){return{item:inputs[\"a\"]}}if(\"b\"in inputs){return{item:inputs[\"b\"]}}throw new Error(\"No value\")};",
"name": "fn_31",
"raw": true
},
"metadata": {
"title": "Coalesce",
"visual": {
"x": 519,
"y": 246,
"collapsed": false
}
}
},
{
"id": "passthrough-30",
"type": "passthrough",
"configuration": {},
"metadata": {
"title": "Relabel Review",
"visual": {
"x": 232,
"y": 301,
"collapsed": false
}
}
}
]
}
I'm putting this here as a pin so I don't forget to find some example boards, but several times, I've had an error when pasting a board that otherwise could be loaded from disk into the visual editor. I'm guessing there is an overzealous validation function for pasting.