Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/package.json b/package.json
index cad8d557e25394d01bc4e95af2f4eb6f11de61ce..ef669ff1a8595e0a347c78055b2f3b9bac035b73 100644
--- a/package.json
+++ b/package.json
@@ -20,7 +20,6 @@
},
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.10",
- "depcheck": "^1.4.3",
"nan": "^2.17.0"
},
"gypfile": true,
1 change: 0 additions & 1 deletion ee/packages/pdf-worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"@react-pdf/renderer": "^3.4.5",
"@rocket.chat/core-typings": "workspace:^",
"@rocket.chat/fuselage-tokens": "~0.33.2",
"emoji-assets": "^7.0.1",
"emoji-toolkit": "^7.0.1",
"moment": "^2.30.1",
"moment-timezone": "^0.5.48",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
"lodash": "4.17.21",
"mongodb": "6.10.0",
"cross-spawn": "7.0.6",
"drachtio-srf": "patch:drachtio-srf@npm%3A5.0.12#~/.yarn/patches/drachtio-srf-npm-5.0.12-b0b1afaad6.patch"
"drachtio-srf": "patch:drachtio-srf@npm%3A5.0.12#~/.yarn/patches/drachtio-srf-npm-5.0.12-b0b1afaad6.patch",
"@sematext/gc-stats@npm:^1.5.9": "patch:@sematext/gc-stats@npm%3A1.5.9#~/.yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch"
Comment on lines +82 to +83

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.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Clarify the purpose of adding the @sematext/gc-stats patch.

The PR objective is to remove unused dependencies, but this change adds a new patch resolution for @sematext/gc-stats. Please clarify:

  1. Is this patch related to removing the dependency, or is it a separate fix?
  2. What does the patch do?
  3. Is @sematext/gc-stats still being used in the codebase after this PR?

Verify if @sematext/gc-stats is actually used in the codebase and inspect the patch contents:


🏁 Script executed:

#!/bin/bash
# Check if @sematext/gc-stats is used as a dependency
echo "=== Checking package.json files for @sematext/gc-stats dependency ==="
fd -e json package.json -x grep -l "@sematext/gc-stats" {}

echo -e "\n=== Checking for imports or requires of gc-stats in the codebase ==="
rg -nP --type=ts --type=js -C3 "(require|import).*gc-stats|gc-stats"

echo -e "\n=== Inspecting the patch file contents ==="
cat .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch 2>/dev/null || echo "Patch file not found in current branch"

Length of output: 1152


</parameter>
</invoke>

---

🏁 Script executed:

```shell
#!/bin/bash
# Check if @sematext/gc-stats appears in dependencies section (not just resolutions)
echo "=== Checking for @sematext/gc-stats in dependencies section ==="
cat package.json | jq '.dependencies | has("@sematext/gc-stats")'

echo -e "\n=== Checking for @sematext/gc-stats in patchedDependencies section ==="
cat package.json | jq '.patchedDependencies | has("@sematext/gc-stats@npm:1.5.9") // "not found"'

echo -e "\n=== Checking if prometheus-gc-stats depends on @sematext/gc-stats ==="
rg -nP "prometheus-gc-stats" package.json -A2 -B2

echo -e "\n=== Checking patch resolutions section ==="
cat package.json | jq '.resolutions'

Length of output: 438



🏁 Script executed:

#!/bin/bash
# Check if @sematext/gc-stats appears in dependencies section (not just resolutions)
echo "=== Checking for @sematext/gc-stats in dependencies section ==="
cat package.json | jq '.dependencies | has("@sematext/gc-stats")'

echo -e "\n=== Checking for @sematext/gc-stats in patchedDependencies section ==="
cat package.json | jq '.patchedDependencies | keys[]' | grep -i sematext

echo -e "\n=== Checking resolutions section for @sematext/gc-stats ==="
cat package.json | jq '.resolutions | keys[]' | grep -i sematext

echo -e "\n=== Full patch resolutions section ==="
cat package.json | jq '.resolutions | to_entries[] | select(.key | contains("sematext"))'

echo -e "\n=== Checking prometheus-gc-stats entry in package.json ==="
cat package.json | jq '.dependencies | to_entries[] | select(.key | contains("prometheus"))'

Length of output: 543



🏁 Script executed:

#!/bin/bash
# Check all dependencies that remain
echo "=== All remaining dependencies ==="
cat package.json | jq '.dependencies | keys[]'

echo -e "\n=== All remaining devDependencies ==="
cat package.json | jq '.devDependencies | keys[]' | head -20

echo -e "\n=== Check for prometheus references in dependencies ==="
cat package.json | jq '.dependencies | keys[]' | grep -i prometheus

echo -e "\n=== Check for prometheus in devDependencies ==="
cat package.json | jq '.devDependencies | keys[]' | grep -i prometheus

echo -e "\n=== Check if patch file exists ==="
if [ -f .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch ]; then
  echo "Patch file exists. Size:"
  wc -l .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch
else
  echo "Patch file does not exist"
fi

Length of output: 436



🏁 Script executed:

#!/bin/bash
# View the patch file contents
echo "=== Patch file contents ==="
cat .yarn/patches/@sematext-gc-stats-npm-1.5.9-01e77be4d0.patch

echo -e "\n=== Check if collectMetrics.ts import is still present ==="
rg -nP "prometheus-gc-stats" apps/meteor/app/metrics/server/lib/collectMetrics.ts

echo -e "\n=== Check for any gc-stats usage in the entire codebase ==="
rg -nP "prometheus-gc-stats|gc-stats" apps/ --type=ts --type=js | head -20

echo -e "\n=== Check if metrics file or collectMetrics is removed ==="
fd -e ts -e js metrics collectMetrics | head -10

Length of output: 790


Remove patch resolution and fix broken prometheus-gc-stats import or restore the dependency.

The patch resolution for @sematext/gc-stats should not be added. Critical issue discovered:

  1. prometheus-gc-stats was removed from dependencies, but code still imports it at apps/meteor/app/metrics/server/lib/collectMetrics.ts:10
  2. The patch file content (removes "depcheck") is unrelated to @sematext/gc-stats
  3. The patch resolution is orphaned with no parent dependency to patch

Either restore prometheus-gc-stats as a dependency, or remove the import and associated code from collectMetrics.ts.

🤖 Prompt for AI Agents
In package.json around lines 82-83, a patch resolution for @sematext/gc-stats
was added but the project removed prometheus-gc-stats (which collectMetrics.ts
still imports) and the patch file content is unrelated, leaving an orphaned
patch; either restore prometheus-gc-stats as a dependency so the patch applies,
or remove the import and related GC metrics usage from
apps/meteor/app/metrics/server/lib/collectMetrics.ts. To fix: decide whether to
keep GC metrics—if yes, add prometheus-gc-stats back to package.json at the
correct version and remove the stray patch or update the patch to actually
target @sematext/gc-stats; if no, remove the import line and all references to
prometheus-gc-stats from collectMetrics.ts and delete the @sematext/gc-stats
patch resolution from package.json so there are no orphaned patches.

},
"dependencies": {
"@types/stream-buffers": "^3.0.7",
Expand Down
1 change: 0 additions & 1 deletion packages/livechat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
"file-loader": "^6.2.0",
"html-webpack-plugin": "~5.6.4",
"if-env": "^1.0.4",
"image-webpack-loader": "~8.1.0",
"lorem-ipsum": "^2.0.8",
"mini-css-extract-plugin": "~2.9.4",
"npm-run-all": "^4.1.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/livechat/webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ const config = (_env: any, args: webpack.WebpackOptionsNormalized): webpack.Conf
},
{
test: /\.svg$/,
use: [require.resolve('./svg-component-loader'), 'svg-loader', 'image-webpack-loader'],
use: [require.resolve('./svg-component-loader'), 'svg-loader'],
},
{
test: /\.s?css$/,
Expand Down
Loading
Loading