fix(chat): make cloud the only truth for charts, synastry, and pin/archive
Local fallbacks were creating fake saves and resurrecting deleted rows. Pin and archive now live on chat_sessions so they follow the account. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -126,7 +126,9 @@ def test_chat_page_uses_authenticated_cloud_persistence() -> None:
|
||||
assert "系统正在以账户记录为准同步点数" in source
|
||||
assert "回答中途断开,已保留现有内容,本次已计费。" not in source
|
||||
assert "本次已开始生成并计费" not in source
|
||||
assert 'localStorage.setItem(chartLibraryStorageKey(accountId)' in source
|
||||
# Former value: `localStorage.setItem(chartLibraryStorageKey(accountId)`
|
||||
# wrote a local library copy on cloud save failure.
|
||||
assert "localStorage.setItem(chartLibraryStorageKey(accountId)" not in source
|
||||
assert 'localStorage.setItem("chat_sessions"' not in source
|
||||
|
||||
|
||||
@@ -180,19 +182,24 @@ def test_chart_profile_library_has_cloud_table_api_and_local_fallback() -> None:
|
||||
"draftSynastryQuestionFromChart",
|
||||
"synastryReportCard",
|
||||
"synastryHistory",
|
||||
"synastryHistoryStorageKey",
|
||||
"discardLegacyCloudMirrorKeys",
|
||||
"synastry-report-card",
|
||||
"synastry-history-list",
|
||||
'fetch("/api/synastry"',
|
||||
"Ashtakoot",
|
||||
"chartLibraryStorageKey",
|
||||
"Cloud chart library is best-effort",
|
||||
"jyotisha_chart_library",
|
||||
"保存失败,请重试",
|
||||
"星盘库",
|
||||
"添加其他星盘",
|
||||
"用于合盘",
|
||||
"设为默认",
|
||||
):
|
||||
assert token in page
|
||||
# Former values: synastryHistoryStorageKey, chartLibraryStorageKey,
|
||||
# and the comment "Cloud chart library is best-effort".
|
||||
assert "synastryHistoryStorageKey" not in page
|
||||
assert "chartLibraryStorageKey" not in page
|
||||
assert "Cloud chart library is best-effort" not in page
|
||||
assert "ayanam-profile" not in page
|
||||
assert "ayanam-sessions" not in page
|
||||
|
||||
@@ -251,11 +258,14 @@ def test_synastry_reports_are_cloud_persisted_per_user() -> None:
|
||||
"fetchCloudSynastryHistory",
|
||||
"saveCloudSynastryReport",
|
||||
'fetch("/api/synastry-reports"',
|
||||
"writeSynastryHistory(accountId, next)",
|
||||
"未能存入历史",
|
||||
"cloud_synastry_history_unavailable",
|
||||
"cloud_synastry_report_save_failed",
|
||||
):
|
||||
assert token in page
|
||||
# Former value: writeSynastryHistory(accountId, next) wrote a local
|
||||
# history copy when cloud save failed.
|
||||
assert "writeSynastryHistory(accountId, next)" not in page
|
||||
|
||||
|
||||
def test_consultation_credit_lifecycle_is_idempotent_and_server_only() -> None:
|
||||
|
||||
Reference in New Issue
Block a user