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

Aperta
#8,975 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript
Ambito
databases

Direzione di ricerca

Inizia eseguendo la riproduzione indicata con pouchdb-adapter-indexeddb 8.0.1 e 9.0.0, quindi esamina come vengono archiviati e interrogati i campi indicizzati contenenti underscore. Confronta il percorso di aggiornamento con gli indici appena creati; il lavoro è completato quando gli indici esistenti continuano a restituire documenti aggiornati senza essere eliminati e ricreati.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
JavaScript
Stelle
17.6k
Fork
1.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/pouchdb

Tutte le issue di apache/pouchdb

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.