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

AskUploadButton renders as "0" due to isAsk sometimes being zero #1548

Closed
petri opened this issue Nov 28, 2024 · 3 comments
Closed

AskUploadButton renders as "0" due to isAsk sometimes being zero #1548

petri opened this issue Nov 28, 2024 · 3 comments
Labels
bug Something isn't working data layer Pertains to data layers.

Comments

@petri
Copy link

petri commented Nov 28, 2024

Describe the bug

With chat history using SQLAlchemy data layer with SQLite, the UI becomes like this (see the zeros):

Näyttökuva 2024-11-28 kello 10 28 07

This is because Message.tsx renders following into zero when isAsk is zero and isRunning is falsy:

{!isRunning && isAsk && (
<AskUploadButton onError={onError} />
)}

That zero value originates from SQLAlchemy layer implementation. Perhaps there should be casting to boolean there.

In my humble opinion, the above UI logic is not optimal either, as evidenced by this issue. There's nothing wrong with preferring readability and simplicity over cleverness and reliance on what could be here considered a side effect.

To Reproduce

Implement chat history with SQLAlchemy & SQLite.

@dosubot dosubot bot added bug Something isn't working data layer Pertains to data layers. labels Nov 28, 2024
petri added a commit to koodaamo/chainlit that referenced this issue Nov 28, 2024
…make sure isRunning & isAsk are always booleans. Possible fix for Chainlit#1548
@dokterbob
Copy link
Collaborator

I agree on explicit vs. implicit (and you're probably right about the SQLAlchemy part - there's more than a few things to be improved there).

Would you please be so kind as to shoot a PR with 0786e17?

dannydabbles pushed a commit to dannydabbles/chainlit that referenced this issue Dec 5, 2024
…make sure isRunning & isAsk are always booleans. Possible fix for Chainlit#1548
@petri
Copy link
Author

petri commented Dec 30, 2024

I agree on explicit vs. implicit (and you're probably right about the SQLAlchemy part - there's more than a few things to be improved there).

Would you please be so kind as to shoot a PR with 0786e17?

@dokterbob there you go.

@willydouhard
Copy link
Collaborator

Should be fixed in the latest release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working data layer Pertains to data layers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants