Skip to content

fix(serve): let variable initialized before used#4060

Merged
esengine merged 1 commit into
esengine:main-v2from
yizeyi18:fix-serve-sessionCount
Jun 12, 2026
Merged

fix(serve): let variable initialized before used#4060
esengine merged 1 commit into
esengine:main-v2from
yizeyi18:fix-serve-sessionCount

Conversation

@yizeyi18

Copy link
Copy Markdown
Contributor

c33d946 introduced cumulant sessionCount in internal/serve/index.html but did not initialize it before using it, causing browser error.

This PR moves the declaration of the variable before where it was used.

Fixes #3621 #4058 .

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 11, 2026
@esengine

Copy link
Copy Markdown
Owner

Correct fix — let sessionCount lived below loadSessions(), so an early loadSessions() call hit the temporal dead zone and threw. Hoisting the declaration above its first use (and dropping the duplicate) resolves it cleanly. Thanks!

@esengine esengine merged commit d579b62 into esengine:main-v2 Jun 12, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 多次更新后 reasonix server 启动的 http://127.0.0.1:8787 会一直加载会话,能输入内容但是无法发送。

2 participants