Skip to content

fix(push): guard passive web push reconciliation#121

Merged
Just-Insane merged 1 commit into
integrationfrom
fix/push-startup-guards
Jun 17, 2026
Merged

fix(push): guard passive web push reconciliation#121
Just-Insane merged 1 commit into
integrationfrom
fix/push-startup-guards

Conversation

@Just-Insane

Copy link
Copy Markdown
Collaborator

Description

Guard passive web-push reconciliation on unsupported browsers and carry the related notification-restore fixes that were developed during the push investigation.

This branch:

  • stops startup and foreground-resume reconciliation from entering the web-push registration path when PushManager is unavailable
  • keeps supported web-push clients on the existing reconciliation path
  • preserves /to/... notification restore behavior across hash-router and call-join deep links
  • stabilizes notification-click room URL construction in the service worker

Related context: follow-up to the recent push recovery work that landed across PRs #116 and #117, and adjacent to the earlier unsupported-browser push fix in PR SableClient#868.

Fixes #

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

@github-actions

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

Status Preview URL Commit Alias Updated (UTC)
✅ Deployment successful! https://pr-121-charm.justin-tech.workers.dev 69e48ab pr-121 Wed, 17 Jun 2026 04:44:07 GMT

@github-code-quality

Copy link
Copy Markdown

Code Coverage Overview

Languages: JavaScript

JavaScript / code-coverage/vitest

The overall coverage in the branch remains at 22%, unchanged from the branch.

Show a code coverage summary of the most impacted files.
File 110a218 69e48ab +/-
src/app/pages/pathUtils.ts 70% 73% +3%
src/app/feature...tifications.tsx 66% 69% +3%
src/app/pages/c...ToRoomEvent.tsx 0% 100% +100%

Code Coverage is in Public Preview. Learn more and provide us with your feedback.

@Just-Insane Just-Insane merged commit 6735ae1 into integration Jun 17, 2026
14 checks passed
@Just-Insane Just-Insane deleted the fix/push-startup-guards branch June 17, 2026 04:45

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 69e48ab239

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/app/pages/App.tsx
Comment on lines +50 to +52
useEffect(() => {
setMatrixToBase(clientConfig.matrixToBaseUrl);
}, [clientConfig.matrixToBaseUrl]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Set the matrix.to base before rendering descendants

When matrixToBaseUrl is configured, moving setMatrixToBase into a passive effect means RouterProvider and its children render once before the module global is updated. The matrix-to helper explicitly relies on this being set before any getMatrixTo* calls, and rendered hrefs such as forwarded-event links can stay on the default https://matrix.to/ until some unrelated re-render happens; previously the base was set synchronously before returning the children.

Useful? React with 👍 / 👎.

Comment thread src/app/pages/Router.tsx
return redirect(getLandingPath(settings.defaultLandingScreen));
}
const afterLoginPath = getAppPathFromHref(getOriginBaseUrl(), window.location.href);
const afterLoginPath = getAppPathFromWindowHref(hashRouter);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Skip redirect capture when the hash is absent

With hashRouter enabled, an unauthenticated user who lands on the bare origin without a # now passes the hash-router config into getAppPathFromWindowHref. getAppPathFromHref assumes a hash exists in that mode, so it slices the full URL as if it were a hash path and stores malformed after-login redirects like /https://host/ (or /ps://host/ with a basename), causing login completion to navigate to a bogus route instead of the normal landing page.

Useful? React with 👍 / 👎.

@Just-Insane Just-Insane restored the fix/push-startup-guards branch June 17, 2026 04:51
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