Skip to content

fix(frontend): keep portal editor context and drop handled chunk-error noise - #1032

Draft
posthog-eu[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixportal-editor-keep-editor-context-51165f
Draft

fix(frontend): keep portal editor context and drop handled chunk-error noise#1032
posthog-eu[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixportal-editor-keep-editor-context-51165f

Conversation

@posthog-eu

@posthog-eu posthog-eu Bot commented Sep 2, 2026

Copy link
Copy Markdown

Problem

  • A workspace admin editing a live portal lost their place in the editor twice while checking the legal-basis setting. The legal basis card's "Workspace settings" link navigated in place, so the host left the form they were filling in, and workspace settings has no way back to the editor (its sidebar back link goes to workspace home).
  • A handled stale-deploy error keeps filing a fresh error tracking issue on every deploy. A tab on an old build requests hashed assets the newest deploy no longer serves (Unable to preload CSS for /assets/<Route>-<hash>.css, Failed to fetch dynamically imported module).

Neither signal shows broad user harm (P3). The full context is in the linked report.

Changes

  • Legal basis link opens in a new tab. The link already carries an external-link icon; it now behaves like one (target="_blank", href with the active language prefix), so the editor form stays open. This replaces the in-place navigate(...) call.
  • Drop the handled chunk-error class in PostHog before_send. recoverFromChunkFailure already reloads a stale tab onto the new build, but the vite:preloadError listener rethrows on purpose (cancelling it makes Vite resolve the import to undefined and throw a misleading error). A new before_send filter drops $exception events whose message is a Vite preload/dynamic-import miss. The app_version_reloaded event stays the health metric.

Why the vision scanner's "app reverts the page" reading is not the cause

There is no automatic redirect in ProjectLegalBasisSection.tsx. The context loss is real, but it comes from the in-place link, not a page revert.

Tests

  • pnpm local binaries: tsc --noEmit and biome check pass on the changed files.
  • Added isChunkLoadErrorMessage unit tests (browser message variants match; unrelated exceptions and nullish input do not). Full appVersion.test.ts suite: 16 passed.
  • The legal-basis link change is a deterministic anchor-target change; the recorded session in the report documents the in-place navigation it removes.

Created with PostHog Desktop from this inbox report.

…r noise

Two frontend fixes:

- The legal basis card's "Workspace settings" link navigated in place, so a
  host filling in the portal editor lost their form and workspace settings
  offered no way back. It now opens in a new tab, matching its external-link
  icon and keeping the editor open.

- Stale-deploy chunk misses ("Unable to preload CSS for ...", "Failed to fetch
  dynamically imported module") are already recovered by recoverFromChunkFailure,
  but the vite:preloadError listener rethrows on purpose, so autocapture files a
  fresh error tracking issue on every deploy. A posthog before_send now drops
  this message class. The app_version_reloaded event stays the health metric.

Generated-By: PostHog Desktop
Task-Id: 106ec2d4-eada-4995-b904-b142c71713f6
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.

0 participants