Upgrading to 9.0.0 breaks indexes for fields which contain an underscore when using indexeddb adapter

Abierto
#8,975 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
35/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
javascript
Área
databases

Línea de trabajo

Comienza ejecutando la reproducción indicada con pouchdb-adapter-indexeddb 8.0.1 y 9.0.0; después, inspecciona cómo se almacenan y consultan los campos indexados que contienen guiones bajos. Compara la ruta de actualización con los índices recién creados; se considera terminado cuando los índices existentes siguen devolviendo documentos actualizados sin eliminarse ni recrearse.

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

Descripción

Versions

We're using the following modules. These were in version 7.2.2 and we updated them to 9.0.0.

  • pouchdb
  • pouchdb-adapter-indexeddb
  • pouchdb-browser
  • pouchdb-find
  • pouchdb-selector-core

The problem only appears to be with the version of pouchdb-adapter-indexeddb module. The versions of the other modules do not affect this. I've also tested upgrading everything to 9.0.0 except this adapter (which i kept to version 7.2.2 once and 8.0.1 the 2nd time i tested it), and the problem below didn't happen.

Issue

After the update to version 9.0.0, every time a document is updated or created, it is not being returned to the search results of some indexes.

We have an index of 2 fields which contain an underscore (WGS_Latitude, WGS_Longitude) and it does not contain the new documents. If we drop and recreate the index after the update, the exact opposite will happen; the updated documents will be returned but not the old ones.

After inspecting indexeddb I saw that every underscore in every field which contained one, was replaced by "c95". The fields appeared normally when fetching docs with db.get().

Example before:
image
Example after:
image

Workaround

If the indexeddb is deleted and replicated again from the remote db, everything appears to be working normally (might not an option for some cases).

Info
  • Environment: ReactJS and Capacitor
  • Platform: Chrome, Android Capacitor App
  • Adapter: indexeddb
  • Server: pouchdb-server
Reproduce
  1. Create a new pouchdb using pouchdb-adapter-indexeddb 8.0.1 or 7.2.2 (other versions haven't been tested).
  2. Create some documents with a field which contains an underscore
  3. Create an index with that field
  4. Upgrade to pouchdb-adapter-indexeddb 9.0.0
  5. Update a doc and try to fetch it with the created index
Lenguaje dominante
JavaScript
Estrellas
17.6k
Forks
1.5k
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

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 apache/pouchdb

Todos los issues de apache/pouchdb

Issues similares

Más issues de JavaScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.