Skip to content

feat(console): realtime guests policy - #14996

Merged
eldadfux merged 3 commits into
mainfrom
feat/console-realtime-guest-policy
Oct 28, 2026
Merged

eldadfux merged 3 commits into
mainfrom
feat/console-realtime-guest-policy

Conversation

@ArnabChatterjee20k

@ArnabChatterjee20k ArnabChatterjee20k commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

What

Adds Auth → Policies → Realtime with one card, Guests, to turn on the deny realtime guests policy (PATCH /v1/project/policies/deny-realtime-guests) from #14945.

  • New tab: Realtime, next to the existing policy tabs. It can be found from policy search and the command center ("Auth · Policies · Realtime").
  • The card: reuses the email policy card (a switch plus an Update button). That card is renamed from EmailPolicyCard to PolicySwitchCard so it can be shared.
  • Current value: read from the project's policy list (ProjectPolicyId.Denyrealtimeguests) into the auth security snapshot.
  • Translations: Japanese and Hebrew strings added.

Screenshots

Off On
realtime-policy-off realtime-policy-on

A refused update shows the server's error, and the card goes back to the stored value, as the email policies do:

realtime-policy-error

These were taken by the new mocked spec, e2e/console.mocked.realtime-policy.spec.ts.

Why Auth → Policies

The endpoint is a project policy, and every other policy toggle lives here. Allowing or refusing guests decides who may use realtime, so it sits with the session and membership policies, not under Settings or Realtime.

SDK

@appwrite.io/console is pinned to the pkg.pr.new build of #14945 at its full head commit (916bc62877a7aab12f7e356cdc2e874f776f47c8). That build has updateDenyRealtimeGuestsPolicy and everything on main, such as Videos.

Before merging

Checks

  • New mocked e2e spec (console.mocked.realtime-policy.spec.ts, 4 tests passing locally): turning the policy on and off sends { enabled: true } and then { enabled: false }, a stored "on" is read back, a refused update shows its error, and policy search finds the card.
  • bun run build and lint:sdk-pins pass.
  • No TypeScript errors in the changed files. tsc still reports errors elsewhere in src/, on lines this PR doesn't touch.
  • ESLint: no new findings.
  • i18n:audit:ja and i18n:audit:he pass.
  • routeTree.gen.ts changes only by the new route.

🤖 Generated with Claude Code

Adds Auth > Policies > Realtime with a card for the deny realtime guests
policy, using a console SDK build that includes the endpoint.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@luxor-code-review

luxor-code-review Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review complete. 🟠 1 high

💬 Inline comments (1)

  • 🟠 pkg.vc preview SDK pin violates repo's own lint gate — package.json:62
🧹 Nitpicks (1) — 🟢 1 low
  • 🟢 Policy copy over-promises guest sign-in in URL mode (Realtime.tsx:31) — The policy card says guests "can still connect and sign in over the connection, but their subscriptions are refused" (apps/console/src/components/pages/projects/$projectId/auth/policies/Realtime.tsx:31).

This PR wires a new console policies page for denying realtime subscriptions to guests, covering route, tab navigation, settings hooks, and i18n dictionaries. The realtime policy toggle is correctly plumbed through the settings hook and the server-side policy action, and the new route mirrors its sibling policy routes.

Files Change
apps/console/src/routes/_public/projects.$projectId.auth.policies.realtime.tsx, policies/Realtime.tsx, policies/Layout.tsx, auth/View.tsx, routeTree.gen.ts New realtime policies sub-tab: route file, toggle card, nav entry, and tab routing.
apps/console/src/lib/project-settings.ts, lib/react-query/hooks/auth.ts, settings-search/policies-settings-cards.ts, command-center/entries/project-tabs.ts Settings plumbing: policy id mapping, query hooks and invalidation, search and tab entries.
apps/console/src/lib/i18n/dictionaries/{he,ja}/auth-storage.ts Hebrew and Japanese translations for the new policy strings.
apps/console/package.json, apps/console/bun.lock Switches @appwrite.io/console to a pkg.vc preview pin and regenerates the lockfile.

The main blocker is the dependency change, which violates the repository's own SDK pin lint gate; a minor copy inaccuracy accompanies the new policy card.

Reviewed commit: bf21d5e

@appwrite

appwrite Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

New Console

Project ID: new-console

Sites (1)
Site Status Logs Preview QR
 New Console
new-console
Ready Ready View Logs Preview URL QR Code

Tip

Every Git commit and branch gets its own deployment URL automatically

@ghost

ghost commented Oct 27, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The incremental changes align with the realtime guest policy behavior, and I found no actionable regressions.

Adds an Auth → Policies → Realtime tab for managing the deny-realtime-guests project policy, reading its value from project policy data and updating it through the Console SDK. The change also makes the existing email-policy switch card reusable, wires policy and command-center search, adds Japanese and Hebrew translations, and pins the SDK build containing the endpoint. A mocked Playwright spec covers the initial value, toggling, update failure recovery, and policy search.

Latest changes: The latest commits add mocked Playwright coverage for toggle, readback, failure recovery, and search; clarify guest behavior in the description and Japanese/Hebrew translations; update the SDK pin; and refresh generated GitHub-star data.

Verdict New comments Fixed Still open
💬 Commented 0 0 0

[!NOTE]

Newer commits exist (`0f0b41d`) and will be reviewed. This review is of `3d34819` and does not approve it.
📂 Walkthrough · 15
File Change
apps/console/package.json, apps/console/bun.lock Pins the Console SDK build containing the realtime guest policy endpoint.
apps/console/e2e/console.mocked.realtime-policy.spec.ts Adds mocked Playwright coverage for policy state, updates, errors, and search.
apps/console/src/components/pages/projects/$projectId/auth/View.tsx Renders the Realtime policy view when its tab is active.
apps/console/src/components/pages/projects/$projectId/auth/policies/EmailPoliciesCard.tsx Provides the shared policy switch card used by email and realtime policies.
apps/console/src/components/pages/projects/$projectId/auth/policies/Layout.tsx Adds Realtime to policy navigation and section search.
apps/console/src/components/pages/projects/$projectId/auth/policies/Realtime.tsx Adds the Guests policy card and its update action.
apps/console/src/lib/command-center/entries/project-tabs.ts Adds the Auth · Policies · Realtime command-center entry.
apps/console/src/lib/generated/github-stars.json Refreshes the generated GitHub star counts.
apps/console/src/lib/i18n/dictionaries/he/auth-storage.ts, apps/console/src/lib/i18n/dictionaries/ja/auth-storage.ts Adds or updates the realtime guest policy translations.
apps/console/src/lib/project-settings.ts Includes the deny-realtime-guests value in the auth security snapshot.
apps/console/src/lib/react-query/hooks/auth.ts Adds the policy update mutation and auth-query invalidation.
apps/console/src/lib/settings-search/policies-settings-cards.ts Indexes the Guests policy card for policy search.
apps/console/src/routeTree.gen.ts, apps/console/src/routes/_public/projects.$projectId.auth.policies.realtime.tsx Registers the Realtime route and its loader/access check.
apps/console/src/routes/_public/projects.$projectId.auth.policies.realtime.tsx Adds the route loader and access check for the Realtime policy page.
apps/console/src/routeTree.gen.ts Registers the new Realtime policy route in the generated route tree.

Reviewed the commits since bf21d5e · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Tier S · Looks good to merge. Summary

@luxor-code-review luxor-code-review Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adds a "Realtime" sub-tab under Auth policies with a denyRealtimeGuests toggle and switches the @appwrite.io/console dependency to a pkg.vc preview pin.

Key findings

  • 🟠 pkg.vc preview SDK pin violates repo's own lint gate — package.json:62

Comment thread apps/console/package.json Resolved
ArnabChatterjee20k and others added 2 commits October 28, 2026 14:21
The pkg.vc build predates Videos, so the console no longer built, and
lint:sdk-pins refuses pkg.vc on main. Pins the pkg.pr.new build of #14945
instead, rewords the guests card for connections that list channels, and
adds a mocked e2e spec for the Realtime policies tab.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@ArnabChatterjee20k

Copy link
Copy Markdown
Member Author

On the nitpick about the guests copy in URL mode: fixed in 3d34819. The card now reads "Guest connections that list channels are refused, and other guests must sign in before subscribing", which matches both paths: a URL-mode guest connection is closed when it opens, and a guest subscribing by message is refused until it authenticates.

@eldadfux
eldadfux merged commit 7a76a18 into main Oct 28, 2026
39 checks passed
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.

2 participants