@rljson/db 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.architecture.md +859 -1
- package/README.contributors.md +534 -20
- package/README.public.md +943 -4
- package/README.trouble.md +49 -0
- package/dist/README.architecture.md +859 -1
- package/dist/README.contributors.md +534 -20
- package/dist/README.public.md +943 -4
- package/dist/README.trouble.md +49 -0
- package/dist/db.js +58 -8
- package/dist/db.js.map +1 -1
- package/dist/index.d.ts +4 -0
- package/package.json +13 -13
package/README.trouble.md
CHANGED
|
@@ -6,9 +6,58 @@
|
|
|
6
6
|
|
|
7
7
|
## Table of contents <!-- omit in toc -->
|
|
8
8
|
|
|
9
|
+
- [Tree INSERT operations failing with empty results](#tree-insert-operations-failing-with-empty-results)
|
|
9
10
|
- [Vscode Windows: Debugging is not working](#vscode-windows-debugging-is-not-working)
|
|
10
11
|
- [GitHub actions: Cannot find module @rollup/rollup-linux-x64-gnu](#github-actions-cannot-find-module-rolluprollup-linux-x64-gnu)
|
|
11
12
|
|
|
13
|
+
## Tree INSERT operations failing with empty results
|
|
14
|
+
|
|
15
|
+
Date: 2026-01-28
|
|
16
|
+
|
|
17
|
+
### Symptoms
|
|
18
|
+
|
|
19
|
+
- Tree INSERT operations complete without errors
|
|
20
|
+
- GET queries after INSERT return empty results or only root node
|
|
21
|
+
- Cell length is 1 instead of expected count
|
|
22
|
+
- Navigation stops at root level
|
|
23
|
+
|
|
24
|
+
### Root Cause
|
|
25
|
+
|
|
26
|
+
The `treeFromObject` function from `@rljson/rljson` v0.0.74+ creates an explicit root node with `id='root'` at the end of the tree array. When inserting an already-isolated subtree (from `isolate()`), this created a double-root structure:
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
Auto-root (id='root')
|
|
30
|
+
└─ User-root (id='root')
|
|
31
|
+
└─ actual data nodes
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
When `TreeController` navigates the tree, it stops at the first node with `id='root'` (the auto-root), which has no meaningful data.
|
|
35
|
+
|
|
36
|
+
### Solution
|
|
37
|
+
|
|
38
|
+
✅ **Fixed in current version**: The `db.ts` file now calls `treeFromObject` with `skipRootCreation: true` parameter:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
const trees = treeFromObject(treeObject, true);
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This prevents the automatic root wrapper from being created during INSERT operations.
|
|
45
|
+
|
|
46
|
+
### Verification
|
|
47
|
+
|
|
48
|
+
Run the tree INSERT tests:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pnpm test --run --grep "insert on tree"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
All tree INSERT tests should pass:
|
|
55
|
+
|
|
56
|
+
- "insert on tree root node"
|
|
57
|
+
- "insert on tree deeper leaf"
|
|
58
|
+
- "insert on tree simple branch"
|
|
59
|
+
- "insert new child on branch"
|
|
60
|
+
|
|
12
61
|
## Vscode Windows: Debugging is not working
|
|
13
62
|
|
|
14
63
|
Date: 2025-03-08
|