Skip to content

Conversation

@twassman
Copy link
Contributor

@twassman twassman commented Sep 26, 2025

Fixes #30883

Checklist

@CLAassistant
Copy link

CLAassistant commented Sep 26, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added the Z-Community-PR Issue is solved by a community member's PR label Sep 26, 2025
Copy link
Contributor Author

@twassman twassman left a comment

Choose a reason for hiding this comment

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

Suboptimal — should probably actually recalculate the m.mentions based on message body (without reply relation), but not entirely clear to me what 'correct' design would be

@twassman twassman marked this pull request as ready for review October 8, 2025 19:38
@twassman twassman requested a review from a team as a code owner October 8, 2025 19:39
@twassman twassman requested review from dbkr and t3chguy October 8, 2025 19:39
Copy link
Contributor Author

@twassman twassman left a comment

Choose a reason for hiding this comment

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

This runs forwarded messages through attachMentions() — which just effectively sets m.mentions to empty, as there is no EditorModel for the forwarded message. This feels like the least-bad way to fix #30883 in alignment with the existing codebase, while leaving room for future improvements. Actually determining the m.mentions based on the message body would likely require some degree of structural changes.

Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

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

I see you're working on tests - thanks. This could probably do with a test itself.

@twassman
Copy link
Contributor Author

twassman commented Oct 31, 2025

Linter and tests are fine on my end; not sure why they're failing in the checks.

@dbkr
Copy link
Member

dbkr commented Nov 3, 2025

You probably need to pull the latest changes as I think this is now trying to import something tat no longer exists. I pulled latest changes from develop but unfortunately this wasn't sufficient.

@twassman
Copy link
Contributor Author

twassman commented Nov 4, 2025

Retrying with a fresh install, it seems like the issue may stem from:

error TS2307: Cannot find module '@element-hq/web-shared-components' or its corresponding type declarations.

I am not entirely sure where this dependency is even located, but it does seem to get flagged in the yarn install logs.

yarn install output
yarn install v1.22.22
[1/5] Validating package.json...
[2/5] Resolving packages...
warning Resolution field "[email protected]" is incompatible with requested version "react-is@^17.0.1"
warning Resolution field "[email protected]" is incompatible with requested version "react-is@^18.0.0"
[3/5] Fetching packages...
warning [email protected]: The engine "bare" appears to be invalid.
warning [email protected]: The engine "bare" appears to be invalid.
[4/5] Linking dependencies...
warning " > @element-hq/[email protected]" has incorrect peer dependency "@vector-im/compound-web@^8.2.5".
warning " > @matrix-org/[email protected]" has incorrect peer dependency "react@^18".
warning " > [email protected]" has incorrect peer dependency "react@^16.8.5 || ^17.0.0 || ^18.0.0".
warning " > [email protected]" has incorrect peer dependency "react-dom@^16.8.5 || ^17.0.0 || ^18.0.0".
warning "react-beautiful-dnd > [email protected]" has incorrect peer dependency "react@^16.8.3 || ^17 || ^18".
warning "react-beautiful-dnd > [email protected]" has incorrect peer dependency "react@^16.8.0 || ^17.0.0 || ^18.0.0".
warning " > @storybook/[email protected]" has unmet peer dependency "vite@^5.0.0 || ^6.0.0 || ^7.0.0".
warning "@storybook/react-vite > @joshwooding/[email protected]" has unmet peer dependency "vite@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0".
warning "@storybook/react-vite > @storybook/[email protected]" has unmet peer dependency "vite@^5.0.0 || ^6.0.0 || ^7.0.0".
warning " > @stylistic/[email protected]" has incorrect peer dependency "eslint@>=9.0.0".
warning Workspaces can only be enabled in private projects.
[5/5] Building fresh packages...
[-/6] ⠄ waiting...
[2/6] ⠄ protobufjs
[3/6] ⠄ cpu-features
[4/6] ⠄ @sentry/cli
warning Error running install script for optional dependency: "[…]/element-web/node_modules/cpu-features: Command failed.
Exit code: 1
Command: node buildcheck.js > buildcheck.gypi && node-gyp rebuild
Arguments: 
Directory: […]/element-web/node_modules/cpu-features
Output:
[…]/element-web/node_modules/buildcheck/lib/index.js:115
  throw new Error('Unable to detect compiler type');
  ^

Error: Unable to detect compiler type
at BuildEnvironment.getKind ([…]/element-web/node_modules/buildcheck/lib/index.js:115:9)
at BuildEnvironment.tryCompile ([…]/element-web/node_modules/buildcheck/lib/index.js:537:15)
at BuildEnvironment.checkHeader ([…]/element-web/node_modules/buildcheck/lib/index.js:423:25)
at Object. ([…]/element-web/node_modules/cpu-features/buildcheck.js:16:4)
at Module._compile (node:internal/modules/cjs/loader:1706:14)
at Object..js (node:internal/modules/cjs/loader:1839:10)
at Module.load (node:internal/modules/cjs/loader:1441:32)
at Function._load (node:internal/modules/cjs/loader:1263:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
$ patch-package
patch-package 8.0.1
Applying patches...
@matrix-org/[email protected]
[email protected]
Done in 39.80s.

I am not the most familiar with JS/TS dev; please do forgive any incompetence.

@t3chguy
Copy link
Member

t3chguy commented Nov 4, 2025

@twassman those errors seem related to testcontainers, not any runtime/build dependency for Element Web

 ~/W/element-web   t3chguy/emoji-highlight-no-active-element $  yarn why buildcheck                                             1137ms  Tue Nov  4 10:48:13 2025
yarn why v1.22.22
[1/4] 🤔  Why do we have the module "buildcheck"...?
[2/4] 🚚  Initialising dependency graph...
⠁ (node:29799) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
(Use `node --trace-deprecation ...` to show where the warning was created)
warning Resolution field "[email protected]" is incompatible with requested version "react-is@^17.0.1"
warning Resolution field "[email protected]" is incompatible with requested version "react-is@^18.0.0"
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "testcontainers#ssh-remote-port-forward#ssh2#cpu-features" depends on it
   - Hoisted from "testcontainers#ssh-remote-port-forward#ssh2#cpu-features#buildcheck"
info Disk size without dependencies: "96KB"
info Disk size with unique dependencies: "96KB"
info Disk size with transitive dependencies: "96KB"
info Number of shared dependencies: 0
✨  Done in 0.26s.
 ~/W/element-web   t3chguy/emoji-highlight-no-active-element $  yarn why cpu-features                                            431ms  Tue Nov  4 10:48:22 2025
yarn why v1.22.22
[1/4] 🤔  Why do we have the module "cpu-features"...?
[2/4] 🚚  Initialising dependency graph...
⠁ (node:29840) [DEP0169] DeprecationWarning: `url.parse()` behavior is not standardized and prone to errors that have security implications. Use the WHATWG URL API instead. CVEs are not issued for `url.parse()` vulnerabilities.
(Use `node --trace-deprecation ...` to show where the warning was created)
warning Resolution field "[email protected]" is incompatible with requested version "react-is@^17.0.1"
warning Resolution field "[email protected]" is incompatible with requested version "react-is@^18.0.0"
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "testcontainers#ssh-remote-port-forward#ssh2" depends on it
   - Hoisted from "testcontainers#ssh-remote-port-forward#ssh2#cpu-features"
info Disk size without dependencies: "1.78MB"
info Disk size with unique dependencies: "2.42MB"
info Disk size with transitive dependencies: "2.42MB"
info Number of shared dependencies: 2
✨  Done in 0.30s.

Your issue is attachMentions is no longer exported from SendMessageComposer but instead from a file called messages.ts

I am not entirely sure where this dependency is even located, but it does seem to get flagged in the yarn install logs.

https://github.com/element-hq/element-web/tree/develop/packages/shared-components & https://github.com/element-hq/element-web/blob/develop/package.json#L86

@twassman
Copy link
Contributor Author

twassman commented Nov 4, 2025

Thank you, @t3chguy; that helps. For whatever reason, even just trying to run typecheck on the develop branch itself is still failing, but I've updated the import & hopefully it should work now on your end.

@t3chguy t3chguy added this pull request to the merge queue Nov 5, 2025
Merged via the queue into element-hq:develop with commit 52eb8a9 Nov 5, 2025
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

T-Defect Z-Community-PR Issue is solved by a community member's PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Forwarded messages retain original message's mentions

4 participants