Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[High] Stop silently losing all chats when the saved store exceeds the localStorage quota

Abierto
#39 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
javascript
Área
backend

Línea de trabajo

Start in index.html at saveStore, createAttachment, attachTranscriptToChat, checkQuota, and promptSetPin; trace how attachment data is saved and how PIN encryption writes are ordered. Then inspect the existing encrypted AttachmentStore and the status line/live region. Done when save failures are visible, large attachments respect the localStorage budget, and enabling a PIN preserves the plaintext store until the encrypted write succeeds.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug help wanted

Priority: High. Type: Bug.

When the saved chat store no longer fits in localStorage, every later save fails silently and all chats, messages, and attachments created from that point are gone on the next reload. With PIN protection, turning the PIN on can lose all existing chats immediately.

Every attachment's full extracted text is stored inside chat.attachments as derivedText, plus a second copy as parents and a third as overlapping children segments (createAttachment and attachTranscriptToChat in index.html). All of it goes into the JSON that saveStore writes to localStorage. The only size check, checkQuota, compares the file against navigator.storage.estimate() and a 50 MB cap, which describe the IndexedDB quota, not the roughly 5 MB localStorage limit. A multi-megabyte text file, a long PDF, or a long transcript makes localStorage.setItem throw. saveStore catches the error and only writes to console.error. The app reports the file as attached and the person keeps chatting.

In promptSetPin, localStorage.removeItem(STORE_KEY) runs before the asynchronous encrypted saveStore. If the larger base64 encrypted blob fails to write, the plaintext copy is already deleted and the encrypted copy never lands.

Suggested fix:

  • Show a visible, persistent error in the status line and live region whenever saveStore fails, and keep showing it on every later failure.
  • Move derivedText, parents, segments, and the BM25 index out of the localStorage store into the existing encrypted IndexedDB AttachmentStore, keeping only metadata in chat.attachments.
  • In promptSetPin, write the encrypted blob first and remove STORE_KEY only after the write succeeds. Use the same order when re-wrapping the data key.
  • Check the size against a conservative localStorage budget before attaching and refuse with a clear message when it would not fit.

Source: index.html, saveStore, createAttachment, attachTranscriptToChat, checkQuota, and promptSetPin.

Verification: Source-level trace only. No browser was available in the review environment.


Generated by Claude Code

Lenguaje dominante
HTML
Estrellas
1
Forks
0
Merge medio
5 h 16 min
PR fusionados (30 d)
10

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de DepressionCenter/FieldStationAI

Todos los issues de DepressionCenter/FieldStationAI

Issues similares

Más issues de Backend & API Design

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.