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

Open
petri opened this issue Nov 28, 2024 · 0 comments
Open

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

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

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
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. needs-triage
Projects
None yet
Development

No branches or pull requests

1 participant