Upgrading to 9.0.0 breaks indexes for fields which contain an underscore when using indexeddb adapter
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- javascript
- 领域
- databases
调研方向
首先使用 pouchdb-adapter-indexeddb 8.0.1 和 9.0.0 运行列出的复现步骤,然后检查包含下划线的索引字段是如何存储和查询的。将升级路径与新创建的索引进行比较;当现有索引无需删除并重新创建即可继续返回更新后的文档时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
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:
Example after:
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
- Create a new pouchdb using pouchdb-adapter-indexeddb 8.0.1 or 7.2.2 (other versions haven't been tested).
- Create some documents with a field which contains an underscore
- Create an index with that field
- Upgrade to pouchdb-adapter-indexeddb 9.0.0
- Update a doc and try to fetch it with the created index
- 主要语言
- JavaScript
- 星标
- 17.6k
- 派生
- 1.5k
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
apache/pouchdb 的其他 Issue
-
elemMatch throws TypeError: value is null if array has null element可能已有人在做 @henyanagar 于 144 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 4/5 3-5 天 新手友好度 22/100
-
难度 3/5 1-2 天 新手友好度 55/100
-
难度 3/5 1-2 天 新手友好度 65/100
相似的 Issue
-
Administration: required plugin configuration field stays invalid after restoring its saved value未关闭needs-triage Platform(Default)
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 82/100
nearform/ag-grid-url-sync#314 · 1 个 reaction ·
维护者通常 1 天内回复
-
chore
难度 2/5 1-3 小时 新手友好度 74/100
idean3885/claude-ops-agent#910 ·
维护者通常 1 天内回复
-
S: triage
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
oskarrough/agent-ide#29 · 1 条评论 ·
维护者通常 1 天内回复