Comments (2)
I was able to look into the issue and find what causes this.
The links
array passed to renderInputMessageContent
here is empty. The IV link is pushed to the entities if the length of this array is greater than 0. Since the condition is false in this case, it results in a message without IV.
The above mentioned array is empty because the completedQueries
array (here) is empty.
currentQuery
has the query and completedQueries
is empty. (Since currentQuery
isn't undefined, the renderInputMessageContent
is called with an empty links
.)
The issue seems to be with the query format parsing, obviously.
currentQuery
being defined depends on the length of the query.split("+")
array. In this case, (query: text +FAQ
) the length of split parts array is 2. So the else
case below is executed. In the end, here, a length % 2 === 0
check is performed for setting currentQuery
. As this condition is true for this case, currentQuery
is set, but completedQueries
is emptied as well.
I have to guess that initially the code was written with +closed searches+ in mind. So, if it was a closed search, the length of the split parts would be 3, the len % 2 === 0
check will not be passed and so completedQueries
wouldn't be empty and this bug won't be occurring.
I don't have an actual solution to propose. So, I'm gonna leave others to that. However, as far as I tested and understood, changing the check len % 2 === 0
to len % 2 === 0 && len !== 2
can solve this issue. But I don't think it is a correct solution, even though it doesn't break other searches.
from docs-bot.
Gotta take a look at this soon
from docs-bot.
Related Issues (6)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docs-bot.