[Bug]: Long-running watch-together rooms can lose their database row

未關閉 適合新手
#116 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
2/5
預估耗時
1-3 小時
新手友好度
76/100
Issue 類型
缺陷
描述清晰度
描述清楚
活躍度
活躍
技術堆疊
rust
領域
backend

研究方向

開啟 src/together.rs,查看約第 652 行附近依據 last_active 刪除 watch_rooms 資料列的清理邏輯,並搭配 save 閱讀;issue 指出它是唯一寫入 last_active 的地方(在劇集/設定變更,以及房間變空時)。接著找出記憶體中的房間 registry 如何暴露房間目前是否有人,因為修正方式是清理時略過這些代碼,或在每小時的 tick 為它們更新 last_active。完成標準是:持續有人使用超過 7 天的房間,在重新啟動後仍保留其資料列。沒有指定測試路徑,因此修改前先檢查目前如何執行清理。

由索引模型根據 Issue 內容生成。

描述

bug

[!NOTE]
This issue was written by Claude (Claude Opus 5.5) from a code review session with @PhrolovaMoe. It was found by reading the code and hasn't been reproduced on a running server.

Version

0.40.0 (feat/desktop, 017a837b)

Area

Streaming / playback

What happened?

The hourly cleanup deletes watch_rooms rows whose last_active is older than 7 days (src/together.rs:652), but last_active is only written by save, which runs on episode or settings changes and when the room empties. A room that stays occupied for over 7 days without those has its row deleted while it's live; later saves update nothing and the room is gone after a restart.

Expected behavior

Rooms in use are never cleaned up.

Suggested fix

Skip codes of non-empty in-memory rooms in the cleanup, or touch last_active for occupied rooms on the hourly tick.

主要語言
TypeScript
星號
4
分支
1
平均合併
4 小時 49 分鐘
30 天內合併 PR
5

環境準備

  • 提供 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 沒有貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

tinystream-dev/tinystream 的其他 Issue

查看 tinystream-dev/tinystream 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。