Skip to content

chore(demo): add server-side client requests UI v15 - #3263

Open
MartinCupela wants to merge 3 commits into
release-v15from
chore/demo-server-side-client-v15
Open

chore(demo): add server-side client requests UI v15#3263
MartinCupela wants to merge 3 commits into
release-v15from
chore/demo-server-side-client-v15

Conversation

@MartinCupela

@MartinCupela MartinCupela commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

🎯 Goal

Start building UI for server-side requests to make development and testing faster.

AMtH.webm

MartinCupela and others added 3 commits August 11, 2026 12:17
…lect

Two optional props, both additive — existing callers are unaffected:

- `allowCustomValue` offers the raw search query as a selectable option, so a
  caller can target something the option list does not know about (a channel
  the client has never loaded, for instance). Only surfaced when the query
  matches nothing or already looks fully qualified (`type:id`), so it does not
  clutter searches that do match.
- `emptyLabel` gives the trigger something to show when `value` matches no
  option. The first-option fallback is kept for callers that pass neither prop,
  so nothing changes for the WS event dialog.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Adds an Actions-menu dialog that builds a server-side StreamChat client in the
browser and invokes a registered method against it. Motivating case: writing
another member's channel data, which a browser client cannot do.

Local debugging aid only. Gated behind `?server_side_client=1` so it never
appears unless asked for; the secret is held in component state for the
lifetime of the dialog and is never persisted to localStorage, the URL, or
anywhere else. An API secret grants full admin access — this must not ship in
a real client bundle.

Three v10 constraints shape the implementation:

- `new StreamChat(key, secret)` does not exist — the constructor takes
  `(key, options)` — and `jsonwebtoken` is mapped to false in
  `package.json#browser`, so no server token can be minted in a browser bundle.
  The `{"server":true}` HS256 token is signed with Web Crypto and injected into
  `tokenManager`, which is what `_getToken()` reads for the Authorization
  header.

- `client.channel(...)` throws without a connected user, and the generated
  `updateMemberPartial` sends no `user_id`, so it can only write the caller's
  own membership. Both are avoided by issuing requests through
  `client.api.sendRequest` — the same primitive the generated APIs use, which
  accepts the query params the generated wrappers drop.

- No connection is opened; a server-side client is stateless, so there is no
  connect step. "Check secret" is an optional `getAppSettings` probe that
  surfaces a bad credential before a payload is composed.

Entities, methods, payload templates and invocation live in a registry, so
adding a method needs no dialog changes. A member picker writes `user_id` into
the payload, reading its value back out of the JSON so the two cannot drift.

The secret field is a `type="text"` input masked with `-webkit-text-security`
rather than `type="password"`: 1Password decorates password fields and its
injected UI steals focus, which closes undocked Chrome DevTools on the first
keystroke.

Run outcomes are reported through a NotificationList rendered inside the
dialog, scoped by emitter. Emitting with `targetPanels: ['modal']` keeps them
out of the channel's own notification list.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d7964b23-a9c2-4318-b8a1-8f7faa08b493

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

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.

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (release-v15@be2c8e1). Learn more about missing BASE report.

Additional details and impacted files
@@              Coverage Diff               @@
##             release-v15    #3263   +/-   ##
==============================================
  Coverage               ?   84.08%           
==============================================
  Files                  ?      523           
  Lines                  ?    15900           
  Branches               ?     5047           
==============================================
  Hits                   ?    13370           
  Misses                 ?     2530           
  Partials               ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant