Skip to content

Commit 517e839

Browse files
Tim020claude
andcommitted
Fix CodeQL alert 1154 and add client-v3 to CI tooling
Guard convention-based Pinia dispatch with Object.hasOwn() to prevent accidental dispatch to prototype-inherited method names (CodeQL js/unvalidated-dynamic-method-call #1154). Add dependabot npm entry for /client-v3 and a client-v3 labeler rule so automated dependency updates and PR labels work once client-v3 lands in dev. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 444f036 commit 517e839

3 files changed

Lines changed: 13 additions & 1 deletion

File tree

.github/dependabot.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@ updates:
1818
update-types: ["version-update:semver-major"]
1919
versioning-strategy: increase
2020
target-branch: dev
21+
- package-ecosystem: "npm"
22+
directory: "/client-v3"
23+
schedule:
24+
interval: "daily"
25+
ignore:
26+
- dependency-name: "*"
27+
update-types: ["version-update:semver-major"]
28+
versioning-strategy: increase
29+
target-branch: dev
2130
- package-ecosystem: "npm"
2231
directory: "/electron"
2332
schedule:

.github/labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ labels:
3333
- label: "client"
3434
files:
3535
- "electron/.*"
36+
- label: "client-v3"
37+
files:
38+
- "client-v3/.*"
3639
- label: "server"
3740
files:
3841
- "server/.*"

client-v3/src/composables/useWebSocket.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ async function dispatchAction(action: string, data: Record<string, unknown>): Pr
139139
if (pinia) {
140140
const storeMap = (pinia as unknown as { _s: Map<string, Record<string, unknown>> })._s;
141141
for (const store of storeMap.values()) {
142-
if (typeof store[camelAction] === 'function') {
142+
if (Object.hasOwn(store, camelAction) && typeof store[camelAction] === 'function') {
143143
await (store[camelAction] as (d: Record<string, unknown>) => Promise<void>)(data);
144144
return;
145145
}

0 commit comments

Comments
 (0)