Skip to content

feat(playground): Add auth gate, session persistence and token display to shareable playground - #12519

Merged
Cristhianzl merged 23 commits into
release-1.9.0from
cz/fix-login-shareable-playground
Apr 7, 2026
Merged

feat(playground): Add auth gate, session persistence and token display to shareable playground#12519
Cristhianzl merged 23 commits into
release-1.9.0from
cz/fix-login-shareable-playground

Conversation

@Cristhianzl

@Cristhianzl Cristhianzl commented Apr 6, 2026

Copy link
Copy Markdown
Member

OBJECTIVE: Enforce authentication on the shareable playground, persist chat sessions to the database for logged-in users, and display token usage and build duration on bot messages.

CHANGES:

  • Add PlaygroundAuthGate component that enforces login when AUTO_LOGIN=FALSE
  • Persist messages to DB for authenticated users via 6 new /monitor/messages/shared/* endpoints
  • Display token usage and build duration on bot messages using shared MessageMetadata component
  • Extract persistMessageProperties helper and compute_virtual_flow_id utility (DRY refactor)
  • Add 52 tests covering auth, endpoints, components, isolation, and edge cases

@coderabbitai

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 3fad4f5d-8ab8-4df4-bd07-4588c64e2c54

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch cz/fix-login-shareable-playground

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added the bug Something isn't working label Apr 6, 2026
@codecov

codecov Bot commented Apr 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 62.37113% with 219 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.33%. Comparing base (4b64f20) to head (1bad524).
⚠️ Report is 6 commits behind head on release-1.9.0.

Files with missing lines Patch % Lines
...ponents/authorization/playgroundAuthGate/index.tsx 3.12% 62 Missing ⚠️
src/backend/base/langflow/api/v1/monitor.py 50.58% 42 Missing ⚠️
...rollers/API/queries/messages/use-rename-session.ts 0.00% 34 Missing ⚠️
src/frontend/src/utils/buildUtils.ts 51.92% 25 Missing ⚠️
...ollers/API/queries/messages/use-delete-sessions.ts 37.03% 17 Missing ⚠️
...l/components/chatView/chatMessage/chat-message.tsx 0.00% 9 Missing ⚠️
...API/queries/messages/use-get-sessions-from-flow.ts 83.33% 7 Missing ⚠️
...chat-view/chat-messages/components/bot-message.tsx 16.66% 5 Missing ⚠️
...c/frontend/src/modals/IOModal/playground-modal.tsx 0.00% 5 Missing ⚠️
src/frontend/src/pages/Playground/index.tsx 0.00% 4 Missing ⚠️
... and 3 more

❌ Your project status has failed because the head coverage (49.26%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files

Impacted file tree graph

@@                Coverage Diff                @@
##           release-1.9.0   #12519      +/-   ##
=================================================
+ Coverage          49.91%   50.33%   +0.41%     
=================================================
  Files               1930     1937       +7     
  Lines             171910   172749     +839     
  Branches           24004    24285     +281     
=================================================
+ Hits               85811    86955    +1144     
+ Misses             85054    84743     -311     
- Partials            1045     1051       +6     
Flag Coverage Δ
backend 55.94% <61.11%> (-0.02%) ⬇️
frontend 49.29% <62.65%> (+0.58%) ⬆️
lfx 49.26% <ø> (+0.18%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/backend/base/langflow/api/utils/flow_utils.py 72.41% <100.00%> (-0.53%) ⬇️
src/backend/base/langflow/api/v1/chat.py 47.79% <100.00%> (+0.53%) ⬆️
src/backend/base/langflow/services/auth/utils.py 89.54% <100.00%> (+0.89%) ⬆️
.../components/authorization/authLoginGuard/index.tsx 65.78% <100.00%> (+9.03%) ⬆️
...mponents/common/messageMetadataComponent/index.tsx 95.37% <100.00%> (ø)
...pHeaderComponent/components/ThemeButtons/index.tsx 37.81% <100.00%> (ø)
...trollers/API/helpers/persist-message-properties.ts 100.00% <100.00%> (ø)
...ntrollers/API/queries/messages/use-get-messages.ts 96.87% <100.00%> (+46.15%) ⬆️
...tend/src/modals/IOModal/helpers/playground-auth.ts 100.00% <100.00%> (ø)
.../frontend/src/modals/IOModal/hooks/useGetFlowId.ts 100.00% <100.00%> (+42.85%) ⬆️
... and 14 more

... and 128 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

github-actions Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Frontend Unit Test Coverage Report

Coverage Summary

Lines Statements Branches Functions
Coverage: 30%
30.34% (32137/105906) 63.74% (4112/6451) 31.44% (750/2385)

Unit Test Results

Tests Skipped Failures Errors Time
3182 0 💤 0 ❌ 0 🔥 5m 22s ⏱️

@github-actions github-actions Bot added the lgtm This PR has been approved by a maintainer label Apr 6, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Apr 6, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Apr 6, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Apr 6, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Apr 6, 2026
@github-actions github-actions Bot added bug Something isn't working and removed bug Something isn't working labels Apr 6, 2026
@Cristhianzl Cristhianzl changed the title fix(auth): Require authentication on Shareable Playground when auto-login is disabled feat(playground): Add auth gate, session persistence and token display to shareable playground Apr 6, 2026
@github-actions github-actions Bot added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Apr 6, 2026
@github-actions github-actions Bot removed the enhancement New feature or request label Apr 6, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 6, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 6, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 7, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 7, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 7, 2026
@github-actions github-actions Bot added enhancement New feature or request and removed enhancement New feature or request labels Apr 7, 2026
@Cristhianzl
Cristhianzl merged commit 8c50fca into release-1.9.0 Apr 7, 2026
98 of 102 checks passed
@Cristhianzl
Cristhianzl deleted the cz/fix-login-shareable-playground branch April 7, 2026 20:03
Adam-Aghili pushed a commit that referenced this pull request Apr 15, 2026
…y to shareable playground (#12519)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Adam-Aghili pushed a commit that referenced this pull request Apr 15, 2026
…y to shareable playground (#12519)

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants