dailyArchive wrote the voteHistory doc twice per active user per day: once data-only before judgeDay, then again with judgment fields inside judgeDay. Drop the pre-write so judgeDay is the single writer in the common path. To keep data safety: judgeDay now persists the doc before userVotes is removed; on the idempotent guard-skip path judgeDay restores data only if the doc is missing (crash-after-tx recovery); and if judgeDay throws, dailyArchive still saves data-only before removal, preserving the prior failure-path behavior. judgment/points/streak results unchanged.
Description
No description provided
Languages
TypeScript
85.5%
HTML
14.5%