Skip to content

[BUDI-9339] Fix App Scripts for public users - #19822

Merged
melohagan merged 3 commits into
masterfrom
fix/budi-9339-public-app-scripts
Oct 7, 2026
Merged

melohagan merged 3 commits into
masterfrom
fix/budi-9339-public-app-scripts

Conversation

@melohagan

@melohagan melohagan commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Description

App Scripts and their CSP whitelist entries were omitted for logged-out visitors, even when the workspace was licensed. Licensing ran before the workspace middleware created the public-user context.

Run licensing after workspace resolution so the existing script-rendering and CSP checks receive the resolved tenant's license for both public and authenticated users.

Validation:

  • Four regression tests cover licensed and unlicensed visitors, both public and authenticated, including Head scripts, Body scripts, stylesheets, and CSP whitelist entries.
  • All 51 static-route, workspace middleware, authentication, and user tests pass. Another 16 authorization and cross-tenant regression tests pass.
  • ESLint and Prettier pass for the changed files.
  • Browser verification confirms that the published public screen includes and executes its App Script with and without login cookies.
  • Type checking reports two existing Koa request-body incompatibilities in packages/types/src/sdk/koa.ts.

Authentication still runs before workspace resolution, and route authorization remains afterward. Public requests now load the cached tenant license; the user quota check uses usageChange: 0.

Addresses

Fixes #16172

BUDI-9339

Screenshots

The recording shows a published Public user screen and its saved Head App Script, then the same published URL while logged in, after clearing all cookies, and after restoring login cookies. The script banner remains visible in each session. The bottom verification overlay reports the measured script/style tag counts and execution flag. Recorded on the local development stack with a development Enterprise license.

issue-16172-fix.mp4

Launchcontrol

App scripts and styles now render for logged-out visitors on public screens when the workspace has the required license.

@melohagan
melohagan marked this pull request as ready for review October 7, 2026 12:31

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

All reported issues were addressed across 2 files

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread packages/server/src/api/routes/tests/static.spec.ts
Comment thread packages/server/src/api/index.ts

@jvcalderon jvcalderon left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@melohagan
melohagan merged commit 7b07e46 into master Oct 7, 2026
37 checks passed
@melohagan
melohagan deleted the fix/budi-9339-public-app-scripts branch October 7, 2026 14:18
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

App scripts don't render on public screens as a non logged in user

2 participants

Sponsor
SponsoredKunjungi sekarang
Promo