Skip to content

Commit 252d908

Browse files
author
shijiashuai
committed
fix: resolve race conditions, security issues, and cleanup configurations
- Fix broadcastMembers TOCTOU race condition in hub.go by using single critical section with deferred unlock - Remove unsafe Math.random() fallback in client ID generation, throw explicit error for unsupported browsers - Add error logging for all sendError() calls in hub.go - Fix HTML aria-label formatting bug in nav-header.html - Fix pre-commit hook temporary file concurrency issue using mktemp - Consolidate duplicate changelog entries (2026-03-09, 2026-03-10) - Fix TodoWrite tool reference to TaskCreate/TaskUpdate in skill file - Optimize pages.yml fetch-depth from 0 to 1 - Update client ID test to expect error instead of unsafe fallback All tests pass: make test, cd web && npm test
1 parent f1da374 commit 252d908

15 files changed

Lines changed: 271 additions & 157 deletions

File tree

.claude/skills/openspec-propose/SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ When ready to implement, run /opsx:apply
4949

5050
4. **Create artifacts in sequence until apply-ready**
5151

52-
Use the **TodoWrite tool** to track progress through the artifacts.
52+
Use the **TaskCreate** and **TaskUpdate tools** to track progress through the artifacts.
5353

5454
Loop through artifacts in dependency order (artifacts with no pending dependencies first):
5555

.githooks/pre-commit

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ fi
2222

2323
text_files="$(printf '%s\n' "${staged_files}" | rg '\.(md|html|yml|yaml|json)$' || true)"
2424
if [[ -n "${text_files}" ]]; then
25-
if rg -n '\.meta/|/specs/|specs/(product|rfc|api|db|testing|README)' ${text_files} >/tmp/webrtc-hook-legacy-refs.txt 2>/dev/null; then
25+
tmpfile=$(mktemp)
26+
trap 'rm -f "$tmpfile"' EXIT
27+
if rg -n '\.meta/|/specs/|specs/(product|rfc|api|db|testing|README)' ${text_files} >"$tmpfile" 2>/dev/null; then
2628
echo "pre-commit: legacy /specs/ or .meta/ reference detected in staged files" >&2
27-
cat /tmp/webrtc-hook-legacy-refs.txt >&2
28-
rm -f /tmp/webrtc-hook-legacy-refs.txt
29+
cat "$tmpfile" >&2
2930
exit 1
3031
fi
31-
rm -f /tmp/webrtc-hook-legacy-refs.txt
3232
fi

.github/workflows/pages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Checkout
3636
uses: actions/checkout@v4
3737
with:
38-
fetch-depth: 0
38+
fetch-depth: 1
3939

4040
- name: Setup Pages
4141
uses: actions/configure-pages@v5

_includes/nav-header.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@
6868
<div class="nav-lang">
6969
<a href="{{ en_url | relative_url }}"
7070
class="lang-link{% unless page.url contains '.zh-CN' %} active{% endunless %}"
71-
aria-label="English
72-
73-
version"
71+
aria-label="English version"
7472
title="English">
7573
EN
7674
</a>

changelog/archive/2026-03-09_stability-and-security.md renamed to changelog/archive/2026-03-09.md

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# 2026-03-09 — Stability & Security
1+
# 2026-03-09 — Stability, Security & Pages Setup
22

33
> Type: `fix` | Impact: High
44
55
## Summary
66

7-
Critical bug fixes for goroutine lifecycle and resource exhaustion prevention.
7+
Critical bug fixes for goroutine lifecycle, resource exhaustion prevention, and GitHub Pages setup.
88

99
## Critical Fixes
1010

@@ -25,7 +25,29 @@ Critical bug fixes for goroutine lifecycle and resource exhaustion prevention.
2525
- `MaxRooms = 1000`
2626
- `MaxClientsPerRoom = 50`
2727

28-
## Improvements
28+
## Features
29+
30+
### GitHub Pages
31+
32+
- Jekyll configuration with SEO support
33+
- Custom homepage (`index.md`)
34+
- Custom 404 page
35+
- Changelog index page
36+
37+
### Go Backend
38+
39+
- `.golangci.yml` with 11 linters
40+
- 11 new test cases for edge cases
41+
42+
### CI/CD
43+
44+
- Separate `lint` job
45+
- Coverage output
46+
47+
### Frontend
48+
49+
- Meta description and theme-color tags
50+
- SVG emoji favicon
2951

3052
### WebSocket Auto-reconnection
3153

@@ -35,7 +57,15 @@ Critical bug fixes for goroutine lifecycle and resource exhaustion prevention.
3557
## Files Changed
3658

3759
- `internal/signal/hub.go`
60+
- `internal/signal/hub_test.go`
3861
- `web/app.signaling.js`
62+
- `web/index.html`
63+
- `_config.yml`
64+
- `index.md`
65+
- `404.md`
66+
- `CHANGELOG.md`
67+
- `.golangci.yml`
68+
- `.github/workflows/ci.yml`
3969

4070
## Security Impact
4171

changelog/archive/2026-03-09_pages-and-quality.md

Lines changed: 0 additions & 42 deletions
This file was deleted.

changelog/archive/2026-03-10.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# 2026-03-10 — Workflow Standardization & Pages Optimization
2+
3+
> Type: `chore` | Impact: Low
4+
5+
## Summary
6+
7+
GitHub Actions workflow standardization and GitHub Pages deployment optimizations.
8+
9+
## Changes
10+
11+
### Workflow Standardization
12+
13+
- Renamed CI workflow `go.yml``ci.yml`
14+
- Unified `permissions` and `concurrency` configuration
15+
- Added `actions/configure-pages@v5` step
16+
- Added `paths` filter to reduce unnecessary builds
17+
18+
### GitHub Pages Optimization
19+
20+
- CI badge URL fixed from `go.yml` to `ci.yml`
21+
- Workflow filename updated in project structure docs
22+
- Removed non-existent logo reference from `_config.yml`
23+
- Added Jekyll artifacts to `.gitignore`
24+
- `cancel-in-progress: true` for Pages workflow
25+
- Expanded path triggers for Pages deployment
26+
- Pages deployment badge in README
27+
28+
## Files Changed
29+
30+
- `README.md`
31+
- `README.zh-CN.md`
32+
- `index.md`
33+
- `_config.yml`
34+
- `.gitignore`
35+
- `.github/workflows/ci.yml`
36+
- `.github/workflows/pages.yml`
37+
38+
## Benefits
39+
40+
- Consistent workflow naming
41+
- Reduced CI minutes with path filtering
42+
- Better concurrency handling

changelog/archive/2026-03-10_pages-optimization.md

Lines changed: 0 additions & 29 deletions
This file was deleted.

changelog/archive/2026-03-10_workflow-deep-standardization.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)