Skip to content

Adapt OAuth2 implementation to Matrix Spec v1.18 - #34026

Merged
t3chguy merged 17 commits into
developfrom
t3chguy/oauth
Jul 8, 2026
Merged

Adapt OAuth2 implementation to Matrix Spec v1.18#34026
t3chguy merged 17 commits into
developfrom
t3chguy/oauth

Conversation

@t3chguy

@t3chguy t3chguy commented Jun 29, 2026

Copy link
Copy Markdown
Member

Requires matrix-org/matrix-js-sdk#5390
Fixes Fixes #32617

Comment thread apps/web/src/utils/oauth/persistOAuthSettings.ts Dismissed
Comment thread apps/web/src/utils/oauth/persistOAuthSettings.ts Dismissed
…tion or class'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
…o t3chguy/oauth

# Conflicts:
#	apps/web/src/contexts/SDKContext.ts
#	apps/web/test/unit-tests/components/structures/MatrixChat-test.tsx
#	apps/web/test/unit-tests/components/views/settings/tabs/user/SessionManagerTab-test.tsx
#	apps/web/test/unit-tests/contexts/SdkContext-test.ts

const cli = useMatrixClientContext();
const sdkContext = useContext(SDKContext);
const cli = sdkContext.client!;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

A reason to not use anymore the matrix client hook? To avoid circular import?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Just no point using two contexts when one provides both values, MatrixClientContext is such that it claims you always have a client but it can actually return null so this is no less safe.

t3chguy added 2 commits July 6, 2026 09:26
…o t3chguy/oauth

# Conflicts:
#	apps/web/src/Lifecycle.ts
#	apps/web/src/MatrixClientPeg.ts
#	apps/web/test/unit-tests/Lifecycle-test.ts
#	apps/web/test/unit-tests/MatrixClientPeg-test.ts
#	apps/web/test/unit-tests/components/structures/MatrixChat-test.tsx
…o t3chguy/oauth

# Conflicts:
#	apps/web/src/IConfigOptions.ts
#	apps/web/src/Lifecycle.test.ts
#	apps/web/src/Lifecycle.ts
#	apps/web/src/components/views/spaces/SpacePanel.tsx
#	apps/web/src/contexts/SDKContextClass.ts
#	apps/web/src/vector/app.test.ts
#	apps/web/src/viewmodels/menus/UserMenuViewModel.ts
#	apps/web/test/unit-tests/components/structures/MatrixChat-test.tsx
#	apps/web/test/unit-tests/components/views/settings/tabs/user/AccountUserSettingsTab-test.tsx
#	apps/web/test/unit-tests/components/views/settings/tabs/user/SessionManagerTab-test.tsx
#	apps/web/test/viewmodels/menus/UserMenuViewModel-test.ts
@t3chguy
t3chguy added this pull request to the merge queue Jul 8, 2026
Merged via the queue into develop with commit 2bc9656 Jul 8, 2026
51 checks passed
@t3chguy
t3chguy deleted the t3chguy/oauth branch July 8, 2026 08:31
hayaksi1 added a commit to hayaksi1/element-web that referenced this pull request Jul 14, 2026
Brings the fork up to date with element-hq/element-web develop (e74b9f5,
174 commits). 26 conflicted paths resolved; all 42 memorybank-documented fork
features preserved and verified present in the production bundle.

Dependencies:
- matrix-js-sdk: drop the 41.8.0 pin for upstream's github:#develop float. The
  pin can no longer hold: upstream 2bc9656 (element-hq#34026) rewrote utils/oidc/ ->
  utils/oauth/ and imports OAuth2/OAuth2Error/ValidatedAuthMetadata from the
  SDK; neither 41.8.0 nor 41.9.0 ships src/oauth/. Note the merge does NOT do
  this by itself: base and upstream both carry the float and only the fork ever
  changed the line, so it auto-merges to the fork's pin with no conflict marker.
- apps/desktop: drop @stylistic/eslint-plugin (upstream removed eslint in the
  oxlint switch) and @types/auto-launch (fork uses native setLoginItemSettings).
- pnpm-lock.yaml regenerated from upstream's; pins js-sdk 4ee7a80a86.

Desktop:
- config.ts: keep upstream's skeleton/type consolidation, re-implant the fork's
  machine-wide config + deep-merge (MDM) helpers retyped onto JsonDocument.
  JsonObject now comes from shared-types, not ./utils.js.
- electron-main.ts: keep the fork's media-permissions/background-colour/
  window-close wiring and darwin second-instance app.show(), plus upstream's
  renderer-recovery wiring.
- ipc.ts / webcontents-handler.ts: keep the fork's consume-once
  displayMediaCallback and resolveUserDownloadAction at the conflicting hunks,
  while retaining upstream's out-of-hunk changes.
- Take upstream's now-merged renderer-recovery and save-image (element-hq#33988, element-hq#33997).

Web:
- SDKContext split (element-hq#34053): SdkContextClass -> SDKContextClass moved to
  contexts/SDKContextClass.ts. Repathed jumpToDate and thread roomViewStore into
  DateSeparatorViewModel per upstream's MessagePanel pattern. Silent break: only
  tsc catches it, jest mocks the module and passes regardless.
- Settings.tsx: keep tokenizerMode, drop showCallButtonsInComposer (upstream's
  new lint:unused-settings job rejects it).
- _components.pcss: import only the two live stylesheets; dropped entries whose
  files no longer exist would fail the build without lint:style noticing.
- RoomSublist.tsx: accept upstream's deletion; getScrollBehavior's last live
  call site is SessionManagerTab.
- Rescue tests relocated by the vitest migration: Searching.test.ts and
  SeshatIndexManager.test.ts (the latter was at a path no runner collected).
- RoomSearchHeader.tsx: merge the duplicate shared-components import the
  auto-merge produced (oxlint no-duplicates).
- RoomSummaryCardView.tsx: hoist the searchSenders default to a stable
  reference for upstream's new oxlint rule.
- LoggedInView/RoomSearchHeader tests: dispatch the nudge keydown on
  document.body, and provide SDKContext where the header mounts jump-to-date.

Verified: apps/web tsc clean of source errors (3 pre-existing vendored js-sdk
errors remain, re-baselined from 4); all 5 desktop tsconfigs; oxfmt, oxlint,
stylelint, workflows, knip, unused-settings (174/174); jest 573 suites /
5644 tests; vitest rescued files collected; production webpack build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OAuth 2.0-based login fail if the device clock is not in sync

3 participants