fix: prioritize system language over timezone for locale detection (#51), clean up session data on deletion (#47, #680)#797
Open
MrRealORG wants to merge 1 commit into
Conversation
…iaomiMiMo#51), clean up session data on deletion (XiaomiMiMo#47, XiaomiMiMo#680) - Locale detection: Intl.DateTimeFormat().locale (actual system language) is now checked first, before timezone. Previously, timezone was checked first, causing users with English macOS but Asia/Shanghai timezone to always get Chinese. - Session deletion: when a session is deleted, all associated per-session stores (message, todo, task, actor, permission, question, session_cwd, session_diff, session_goal, session_status) are now cleared. Parts belonging to the deleted session's messages are also removed. Previously, this data remained in the SolidJS store forever, causing unbounded memory growth in long-running TUI sessions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two fixes in 2 files:
Fix #51 — Locale auto-detection shows wrong language
detectSystemLocale()checked timezone before system language. A user with English macOS butAsia/Shanghaitimezone always got Chinese.Fix: Reorder priority:
Intl.DateTimeFormat().locale(actual OS language setting)LC_ALL,LC_MESSAGES,LANG,LANGUAGE)Fix #47 / #680 — Session deletion memory leak in TUI
When a session was deleted, only the session entry was removed from the array. All associated per-session store data (messages, parts, todos, tasks, actors, permissions, questions, diffs, status, cwd, goal) remained in the SolidJS store forever.
Fix: Clear all 10 session-scoped stores on
session.deleted, and remove parts belonging to the deleted session's messages. Follows the same pattern asdropSessionCaches()inpackages/app/src/context/global-sync/session-cache.ts.Test Plan