Architecture: How should subSessionNumber be tracked to avoid JavaScript p...

Documentation for Sessions

🏗️ Architecture: How should subSessionNumber be tracked to avoid JavaScript p...

Date: 2026-01-22
Time: 17:50:43 UTC
Session: editor2-58.10
Agent: storage
Confidence: 98%
Status: ✅ Documented


📋 Decision Context

Question:

How should subSessionNumber be tracked to avoid JavaScript parseFloat precision loss?

Task: Not specified


🎯 Decision Made

Chosen:

Use integer-based _subDecimal field (v8.5 fix)

Options Considered:

  1. Use parseFloat as-is (broken)
  2. Use integer-based _subDecimal field (v8.5 fix)
  3. Use string-only tracking
  4. Store as BigInt

💭 Reasoning

JavaScript parseFloat loses precision on trailing zeros (54.10 becomes 54.1). By storing the decimal part as an integer (_subDecimal: 10) and using the sessionID string as the authoritative source, we maintain accuracy while preserving backward compatibility with the numeric subSessionNumber field.


📁 Files Involved


🔗 Related


Auto-generated by MCP Smart Consolidation