@issuegraph/store 0.1.1 → 0.3.0
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.md +57 -30
- package/dist/change.d.ts +4 -2
- package/dist/change.d.ts.map +1 -1
- package/dist/change.js +2 -1
- package/dist/change.js.map +1 -1
- package/dist/mutation.d.ts +10 -1
- package/dist/mutation.d.ts.map +1 -1
- package/dist/mutation.js +10 -0
- package/dist/mutation.js.map +1 -1
- package/dist/source.d.ts +12 -1
- package/dist/source.d.ts.map +1 -1
- package/dist/store.d.ts +25 -2
- package/dist/store.d.ts.map +1 -1
- package/dist/store.js +188 -53
- package/dist/store.js.map +1 -1
- package/dist/validity.d.ts.map +1 -1
- package/dist/validity.js +42 -3
- package/dist/validity.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -71,8 +71,8 @@ interface DataSource {
|
|
|
71
71
|
|
|
72
72
|
| outcome | what it means | what the store does |
|
|
73
73
|
|---|---|---|
|
|
74
|
-
| `applied` | the edit landed; carries the **whole** resulting document | adopts it
|
|
75
|
-
| `unchanged` | the edit changed nothing; carries the **whole** document | adopts it
|
|
74
|
+
| `applied` | the edit landed; carries the **whole** resulting document | adopts it; the order re-derives, with a change summary, once no edit is in flight |
|
|
75
|
+
| `unchanged` | the edit changed nothing; carries the **whole** document | adopts it; the order re-derives once no edit is in flight, and this edit adds **no** summary |
|
|
76
76
|
| `rejected` | the write was refused; carries a reason | marks the edge `failed` and offers `retry` |
|
|
77
77
|
| `conflict` | the document moved upstream mid-edit; carries the current one | marks the edge `conflict` and holds **both** versions |
|
|
78
78
|
|
|
@@ -128,6 +128,16 @@ An optional `EdgeGuard` sits beside it for refusals that need to see the graph
|
|
|
128
128
|
type EdgeGuard = (context: { mutation; current; next }) => InvalidReason | undefined;
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
+
`current` is the **newest document the source has answered with**, which is the landed one
|
|
132
|
+
except after a conflict: the conflict's `upstream` is newer than anything landed, so it is
|
|
133
|
+
what the guard is shown until the next answer that lands replaces it. A verdict reached on
|
|
134
|
+
the pre-conflict document would admit an edit that closes a loop on the source's own document
|
|
135
|
+
(the edge the upstream added, with the one queued behind it), and an adapter applies what it
|
|
136
|
+
is handed. Only the guard reads the newer copy: the order and the drawn edges keep reading
|
|
137
|
+
`landed`, and so do the store's own structural refusals — a duplicate or a vanished edge is a
|
|
138
|
+
question the source answers itself, with a document the store adopts, so letting that
|
|
139
|
+
dispatch through is what repairs the store's copy.
|
|
140
|
+
|
|
131
141
|
---
|
|
132
142
|
|
|
133
143
|
## The order can be trusted, structurally
|
|
@@ -144,7 +154,10 @@ that exists nowhere. Keeping the two sets apart makes that a property of the str
|
|
|
144
154
|
than a rule every reader has to remember.
|
|
145
155
|
|
|
146
156
|
While any edit is in flight, `order.status` is `'held'` and the rows are the previous ones,
|
|
147
|
-
unchanged — a stale-but-labelled order beats a half-computed one.
|
|
157
|
+
unchanged — a stale-but-labelled order beats a half-computed one. That holds across every edit
|
|
158
|
+
in flight, not one at a time: an edit that lands while another is still pending adopts its
|
|
159
|
+
document and leaves the rows alone, and so does a refresh. The order re-derives once, when the
|
|
160
|
+
last pending edit settles. Same principle if your
|
|
148
161
|
deriver throws: the last order that *was* derived stands, and `orderError` says why it is
|
|
149
162
|
stale.
|
|
150
163
|
|
|
@@ -174,13 +187,15 @@ it, split by what the answer needs to see:
|
|
|
174
187
|
|
|
175
188
|
- the store itself, for what is visible in the edit — a self-edge, a reference the document
|
|
176
189
|
does not hold, an exact duplicate, a retype to the kind the edge already has, a flip on a
|
|
177
|
-
symmetric relationship
|
|
190
|
+
symmetric relationship, and a second reference on a single-valued field (`cardinality`:
|
|
191
|
+
every relationship field but `blocked-by` holds one, §4.3 — the one writer rule of the
|
|
192
|
+
format that needs no graph walk, so it is refused here rather than once per host);
|
|
178
193
|
- your `EdgeGuard`, for anything needing the graph.
|
|
179
194
|
|
|
180
195
|
## A failed write is marked, never reverted
|
|
181
196
|
|
|
182
197
|
The user's work stays on the canvas. `retry` re-dispatches it, and on a conflict you get the
|
|
183
|
-
|
|
198
|
+
resolutions below. **Nothing auto-merges, nothing auto-reverts, and nothing
|
|
184
199
|
times out** — `discardMine` is the only call that removes an optimistic edit, and a person has
|
|
185
200
|
to make it.
|
|
186
201
|
|
|
@@ -188,36 +203,48 @@ to make it.
|
|
|
188
203
|
|
|
189
204
|
A conflict's `upstream` is **for display, and is never adopted** — it is the "view diff" half
|
|
190
205
|
of the choice, and a reading of the past: a conflict can sit on screen for as long as a person
|
|
191
|
-
takes to read it.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
store.discardMine(id); // drop the overlay; adopts nothing
|
|
197
|
-
store.retry(id); // re-dispatch, unchanged
|
|
198
|
-
```
|
|
206
|
+
takes to read it. The one other thing it is used for is the guard: it is the newest document
|
|
207
|
+
the source has answered with, so an edit proposed or queued after the conflict is shown to
|
|
208
|
+
your `EdgeGuard` against it rather than against the copy the source has said it no longer
|
|
209
|
+
holds (see "The deriver" above). Shown, not adopted — the order does not move for it, and a
|
|
210
|
+
`retry` is still re-dispatched unchanged.
|
|
199
211
|
|
|
200
|
-
|
|
212
|
+
The store ships three resolutions:
|
|
201
213
|
|
|
202
214
|
```ts
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
215
|
+
store.discardMine(id); // drop the overlay; adopts nothing
|
|
216
|
+
store.retry(id); // re-dispatch, unchanged, against the document as it stands
|
|
217
|
+
store.retryOnLatest(id); // re-read the document, then re-dispatch, unchanged, against what it confirmed
|
|
206
218
|
```
|
|
207
219
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
220
|
+
`discardMine` and `retry` read the record and act on it with no `await` in between, so neither
|
|
221
|
+
can be overtaken. `retryOnLatest` has a read in the middle, and everything that can happen
|
|
222
|
+
during it — the read failing, the user discarding, the user pressing again — is a decision
|
|
223
|
+
about *user intent*. The store settles all three by **reserving the edit before the read**:
|
|
224
|
+
the record is `pending` from the call on, and a pending edit is one `discardMine` and a second
|
|
225
|
+
press decline to touch, exactly as they do while any write is in flight. The read and the
|
|
226
|
+
re-dispatch then run as **one queued operation**, so nothing can be queued between them:
|
|
227
|
+
|
|
228
|
+
- the read **fails** — the record is restored exactly as it was, `upstream` and all, nothing is
|
|
229
|
+
dispatched, and `hydrationError` says why. The conflict is still there to try again;
|
|
230
|
+
- the read **confirms** a document that no longer admits the edit — it is refused `invalid`
|
|
231
|
+
against that document and never dispatched;
|
|
232
|
+
- otherwise the edit goes out against the confirmed document, with the guard judging it there.
|
|
233
|
+
|
|
234
|
+
That reservation is what the store used to lack, and why the composition once had to live in
|
|
235
|
+
the host — [issue #7](https://github.com/autnmy/issuegraph/issues/7) is the record of the three
|
|
236
|
+
defects a hand-rolled version drew. The adapter is the authority on the current document; the
|
|
237
|
+
store asks it rather than keeping a guess about how stale its own copy has become.
|
|
238
|
+
|
|
239
|
+
`lastChange` describes a **held period**: the span from the first edit going pending to the
|
|
240
|
+
last one settling. When the period ends, the store diffs the rows held since it began against
|
|
241
|
+
the order derived once, so two edits that both landed are counted together, and
|
|
242
|
+
`lastChange.mutation` is the newest one that landed. The period's summary is published whatever
|
|
243
|
+
the closing edit's outcome — an earlier edit that landed was saved even if the last one was
|
|
244
|
+
rejected. A period in which nothing landed publishes no summary, because nothing was saved,
|
|
245
|
+
and leaves an earlier summary standing. Starting an edit, a `retry` or a `retryOnLatest` does
|
|
246
|
+
not clear it either: only `dismissChange()` does, or a later period that lands an edit, whose
|
|
247
|
+
summary replaces it.
|
|
221
248
|
|
|
222
249
|
## Two smaller contracts worth knowing
|
|
223
250
|
|
package/dist/change.d.ts
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
*
|
|
19
19
|
* And one thing it must never grow: a timer. The design rejects the toast
|
|
20
20
|
* precisely because the only evidence the edit worked disappears before it is
|
|
21
|
-
* read. `lastChange` persists until
|
|
21
|
+
* read. `lastChange` persists until an explicit dismissal, or until a later
|
|
22
|
+
* edit lands and its summary replaces it.
|
|
22
23
|
*/
|
|
23
24
|
import type { IssueRef } from './model.ts';
|
|
24
25
|
import type { Mutation } from './mutation.ts';
|
|
@@ -52,7 +53,8 @@ export interface ChangeCounts {
|
|
|
52
53
|
readonly left: number;
|
|
53
54
|
}
|
|
54
55
|
/**
|
|
55
|
-
* What the
|
|
56
|
+
* What the edits that landed during one held period did to the order, named
|
|
57
|
+
* by the newest of them.
|
|
56
58
|
*
|
|
57
59
|
* An edit that lands and moves nothing still produces one, with an empty
|
|
58
60
|
* `deltas` and all-zero counts. "This edit changed nothing" is a FINDING — it
|
package/dist/change.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../src/change.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"change.d.ts","sourceRoot":"","sources":["../src/change.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAE5C,yCAAyC;AACzC,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,IAAI,GAAG,MAAM,CAAC;IAClC,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IACjC,kEAAkE;IAClE,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,YAAY,CAAC;IAC/C,iFAAiF;IACjF,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;CACxC;AAED,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;IACtC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;CAC/B;AAMD;;;;;;GAMG;AACH,wBAAgB,SAAS,CACvB,QAAQ,EAAE,SAAS,QAAQ,EAAE,EAC7B,IAAI,EAAE,SAAS,QAAQ,EAAE,EACzB,QAAQ,EAAE,QAAQ,GACjB,WAAW,CAgDb"}
|
package/dist/change.js
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
*
|
|
19
19
|
* And one thing it must never grow: a timer. The design rejects the toast
|
|
20
20
|
* precisely because the only evidence the edit worked disappears before it is
|
|
21
|
-
* read. `lastChange` persists until
|
|
21
|
+
* read. `lastChange` persists until an explicit dismissal, or until a later
|
|
22
|
+
* edit lands and its summary replaces it.
|
|
22
23
|
*/
|
|
23
24
|
function byRef(rows) {
|
|
24
25
|
return new Map(rows.map((row) => [row.ref, row]));
|
package/dist/change.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"change.js","sourceRoot":"","sources":["../src/change.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"change.js","sourceRoot":"","sources":["../src/change.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAoDH,SAAS,KAAK,CAAC,IAAyB;IACtC,OAAO,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CACvB,QAA6B,EAC7B,IAAyB,EACzB,QAAkB;IAElB,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC/B,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC;IAC1B,MAAM,MAAM,GAAgB,EAAE,CAAC;IAE/B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACtB,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;YACnD,SAAS;QACX,CAAC;QACD,MAAM,QAAQ,GACZ,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI;YACnB,CAAC,CAAC,SAAS;YACX,CAAC,CAAC;gBACE,SAAS,EAAE,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM;gBAC9C,EAAE,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;gBACjC,IAAI,EAAE,GAAG,CAAC,IAAI;gBACd,EAAE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,KAAK,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC,MAAM;YAC5E,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,MAAM;YACtE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,KAAK,MAAM,CAAC,CAAC,MAAM;SACjE;KACF,CAAC;AACJ,CAAC"}
|
package/dist/mutation.d.ts
CHANGED
|
@@ -76,8 +76,17 @@ export interface InvalidReason {
|
|
|
76
76
|
* `guard-failed` is the opposite case — the guard threw, so no verdict was
|
|
77
77
|
* reached at all. It refuses rather than proceeding, because an unknown verdict
|
|
78
78
|
* is not permission to write.
|
|
79
|
+
*
|
|
80
|
+
* `cardinality` is a rule of the FORMAT rather than of the store's own
|
|
81
|
+
* structure: every relationship field but `blocked-by` holds one reference
|
|
82
|
+
* (§4.3, `EDGE_CARDINALITY`). It is refused here all the same, because it is
|
|
83
|
+
* visible from the edit and the document alone — the same test that puts
|
|
84
|
+
* `duplicate-edge` here rather than in a guard. Left to hosts, the rule was
|
|
85
|
+
* enforced once per host on one route to a write each, and an adapter that
|
|
86
|
+
* enforced it reported a format rule as an upstream rejection on a write that
|
|
87
|
+
* never left the client (issue #11).
|
|
79
88
|
*/
|
|
80
|
-
export declare const INVALID_CODES: readonly ["self-edge", "unknown-issue", "unknown-edge", "duplicate-edge", "unchanged-kind", "symmetric-edge", "would-cycle", "guard-failed"];
|
|
89
|
+
export declare const INVALID_CODES: readonly ["self-edge", "unknown-issue", "unknown-edge", "duplicate-edge", "unchanged-kind", "symmetric-edge", "cardinality", "would-cycle", "guard-failed"];
|
|
81
90
|
/** A refusal code. */
|
|
82
91
|
export type InvalidCode = (typeof INVALID_CODES)[number];
|
|
83
92
|
//# sourceMappingURL=mutation.d.ts.map
|
package/dist/mutation.d.ts.map
CHANGED
|
@@ -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MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG;IAAE,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAA;CAAE,CAAC;AAEtE,8DAA8D;AAC9D,MAAM,WAAW,aAAa;IAC5B,uEAAuE;IACvE,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,iFAAiF;IACjF,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,6JAUf,CAAC;AAEZ,sBAAsB;AACtB,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
package/dist/mutation.js
CHANGED
|
@@ -44,6 +44,15 @@ export function isEdgeState(value) {
|
|
|
44
44
|
* `guard-failed` is the opposite case — the guard threw, so no verdict was
|
|
45
45
|
* reached at all. It refuses rather than proceeding, because an unknown verdict
|
|
46
46
|
* is not permission to write.
|
|
47
|
+
*
|
|
48
|
+
* `cardinality` is a rule of the FORMAT rather than of the store's own
|
|
49
|
+
* structure: every relationship field but `blocked-by` holds one reference
|
|
50
|
+
* (§4.3, `EDGE_CARDINALITY`). It is refused here all the same, because it is
|
|
51
|
+
* visible from the edit and the document alone — the same test that puts
|
|
52
|
+
* `duplicate-edge` here rather than in a guard. Left to hosts, the rule was
|
|
53
|
+
* enforced once per host on one route to a write each, and an adapter that
|
|
54
|
+
* enforced it reported a format rule as an upstream rejection on a write that
|
|
55
|
+
* never left the client (issue #11).
|
|
47
56
|
*/
|
|
48
57
|
export const INVALID_CODES = Object.freeze([
|
|
49
58
|
'self-edge',
|
|
@@ -52,6 +61,7 @@ export const INVALID_CODES = Object.freeze([
|
|
|
52
61
|
'duplicate-edge',
|
|
53
62
|
'unchanged-kind',
|
|
54
63
|
'symmetric-edge',
|
|
64
|
+
'cardinality',
|
|
55
65
|
'would-cycle',
|
|
56
66
|
'guard-failed',
|
|
57
67
|
]);
|
package/dist/mutation.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mutation.js","sourceRoot":"","sources":["../src/mutation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IACvC,UAAU;IACV,eAAe;IACf,SAAS;IACT,QAAQ;IACR,UAAU;CACF,CAAC,CAAC;AAKZ,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAS,WAAW,CAAC,CAAC;AAEzE,mDAAmD;AACnD,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AA+BD
|
|
1
|
+
{"version":3,"file":"mutation.js","sourceRoot":"","sources":["../src/mutation.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;IACvC,UAAU;IACV,eAAe;IACf,SAAS;IACT,QAAQ;IACR,UAAU;CACF,CAAC,CAAC;AAKZ,MAAM,cAAc,GAAwB,IAAI,GAAG,CAAS,WAAW,CAAC,CAAC;AAEzE,mDAAmD;AACnD,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAO,cAAc,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AACnC,CAAC;AA+BD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,WAAW;IACX,eAAe;IACf,cAAc;IACd,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,aAAa;IACb,aAAa;IACb,cAAc;CACN,CAAC,CAAC"}
|
package/dist/source.d.ts
CHANGED
|
@@ -122,7 +122,18 @@ export type OrderDeriver = (document: GraphDocument) => readonly OrderRow[];
|
|
|
122
122
|
/** What a guard is shown. Both documents, so it need not recompute either. */
|
|
123
123
|
export interface EdgeGuardContext {
|
|
124
124
|
readonly mutation: Mutation;
|
|
125
|
-
/**
|
|
125
|
+
/**
|
|
126
|
+
* The newest authoritative document the source has answered with, before
|
|
127
|
+
* the edit.
|
|
128
|
+
*
|
|
129
|
+
* That is the landed document — except after a `conflict`, whose `upstream`
|
|
130
|
+
* is newer than anything landed and is what the guard sees until the next
|
|
131
|
+
* answer that lands replaces it. A verdict reached on the pre-conflict
|
|
132
|
+
* document would admit an edit that closes a loop on the source's own
|
|
133
|
+
* document, and a source applies what it is handed. The store's structural
|
|
134
|
+
* refusals keep reading the landed document: those are questions the source
|
|
135
|
+
* answers itself, and its answer is adopted.
|
|
136
|
+
*/
|
|
126
137
|
readonly current: GraphDocument;
|
|
127
138
|
/** The document the edit would produce, if it landed. */
|
|
128
139
|
readonly next: GraphDocument;
|
package/dist/source.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE7D;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,WAAW,UAAU;IACzB,4EAA4E;IAC5E,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,CAAC;IAClC,oFAAoF;IACpF,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CACvD;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,cAAc,GACtB;IACE;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC;CAClC,GACD;IACE;;;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AE,gBAAgB,KAAK,aAAa,GAAG,SAAS,CAAC"}
|
package/dist/store.d.ts
CHANGED
|
@@ -49,7 +49,11 @@ export interface StoreSnapshot {
|
|
|
49
49
|
readonly order: OrderView;
|
|
50
50
|
/** Edits still carrying a state: pending, invalid, failed or conflicted. */
|
|
51
51
|
readonly writes: readonly WriteRecord[];
|
|
52
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* What the writes saved during the last held period did to the order, once
|
|
54
|
+
* the period ended. Stays until `dismissChange()`, or until a later period
|
|
55
|
+
* that saves a write replaces it.
|
|
56
|
+
*/
|
|
53
57
|
readonly lastChange?: OrderChange;
|
|
54
58
|
/**
|
|
55
59
|
* Why the order could not be recomputed, when the injected deriver threw.
|
|
@@ -100,6 +104,22 @@ export interface Store {
|
|
|
100
104
|
propose(proposal: Proposal): ProposalHandle;
|
|
101
105
|
/** Re-dispatch an unsettled edit, unchanged, against the document as it stands. */
|
|
102
106
|
retry(mutationId: MutationId): ProposalHandle;
|
|
107
|
+
/**
|
|
108
|
+
* Re-read the document from the source, then re-dispatch an unsettled edit,
|
|
109
|
+
* unchanged, against what that read confirmed — as ONE queued operation.
|
|
110
|
+
*
|
|
111
|
+
* The edit is reserved synchronously: it is `pending` from this call on, so
|
|
112
|
+
* `discardMine` and a second press are no-ops until it settles, exactly as
|
|
113
|
+
* they are for `retry`. A refresh that fails restores the record as it was
|
|
114
|
+
* and dispatches nothing; `hydrationError` says why. See the README's
|
|
115
|
+
* "Resolving a conflict".
|
|
116
|
+
*
|
|
117
|
+
* Accepts any record `retry` accepts — `conflict`, `failed` or `invalid` —
|
|
118
|
+
* and reaches its verdict only after the read, so an edit refused for a
|
|
119
|
+
* reason no document can change (a self-edge) costs one read before it is
|
|
120
|
+
* refused again.
|
|
121
|
+
*/
|
|
122
|
+
retryOnLatest(mutationId: MutationId): ProposalHandle;
|
|
103
123
|
/**
|
|
104
124
|
* Drop an unsettled edit's overlay. The only call that removes the user's
|
|
105
125
|
* work, and it adopts nothing. See the README's "Resolving a conflict".
|
|
@@ -107,7 +127,10 @@ export interface Store {
|
|
|
107
127
|
discardMine(mutationId: MutationId): void;
|
|
108
128
|
/** Set the selected edges. Selection is client state; it writes nothing. */
|
|
109
129
|
select(edgeIds: readonly EdgeId[]): void;
|
|
110
|
-
/**
|
|
130
|
+
/**
|
|
131
|
+
* Clear the change summary. The only thing that does, besides a later held
|
|
132
|
+
* period that saves a write and replaces it.
|
|
133
|
+
*/
|
|
111
134
|
dismissChange(): void;
|
|
112
135
|
}
|
|
113
136
|
/**
|
package/dist/store.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,KAAK,MAAM,EAEX,KAAK,UAAU,EACf,KAAK,WAAW,EAEjB,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAA2B,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACnF,OAAO,KAAK,EAAE,UAAU,EAAkB,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACjG,OAAO,EAAE,KAAK,WAAW,EAAa,MAAM,aAAa,CAAC;AAE1D,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAuB,MAAM,YAAY,CAAC;AAGvF,0EAA0E;AAC1E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExE;;;;;;GAMG;AACH,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;AAE7C,sEAAsE;AACtE,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,IAAI,EAAE,SAAS,QAAQ,EAAE,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;CAC9B;AAED,gFAAgF;AAChF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAA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AO,CAAC,IAAI,CAAC,CAAC;IAC3B,yEAAyE;IACzE,OAAO,CAAC,QAAQ,EAAE,QAAQ,GAAG,cAAc,CAAC;IAC5C,mFAAmF;IACnF,KAAK,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,CAAC;IAC9C;;;;;;;;;;;;;;OAcG;IACH,aAAa,CAAC,UAAU,EAAE,UAAU,GAAG,cAAc,CAAC;IAEtD;;;OAGG;IACH,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1C,4EAA4E;IAC5E,MAAM,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAAC;IACzC;;;OAGG;IACH,aAAa,IAAI,IAAI,CAAC;CACvB;AAqFD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,WAAW,GAAG,KAAK,CAgmBtD"}
|
package/dist/store.js
CHANGED
|
@@ -104,6 +104,40 @@ function messageOf(thrown) {
|
|
|
104
104
|
export function createStore(config) {
|
|
105
105
|
const { source, derive, guard } = config;
|
|
106
106
|
let landed = EMPTY_DOCUMENT;
|
|
107
|
+
/**
|
|
108
|
+
* THE NEWEST AUTHORITATIVE DOCUMENT THE SOURCE HAS ANSWERED WITH, which is
|
|
109
|
+
* `landed` except after a `conflict`.
|
|
110
|
+
*
|
|
111
|
+
* A conflict carries the document as the source holds it, and the store
|
|
112
|
+
* adopts none of it — the order must not move for an edit that did not land,
|
|
113
|
+
* and the README's "Resolving a conflict" says why the upstream is for
|
|
114
|
+
* display. But it is also the one thing the store has been TOLD about the
|
|
115
|
+
* source's document since it last read one, and it is strictly newer than
|
|
116
|
+
* `landed`. Validating against `landed` after it arrives means checking an
|
|
117
|
+
* edit against a document the source has just said it no longer holds: a
|
|
118
|
+
* queued edit whose legality depends on the upstream's change — the very
|
|
119
|
+
* edge it added closing a cycle with this one — is admitted by a guard shown
|
|
120
|
+
* the pre-conflict graph, and lands against a source that has moved
|
|
121
|
+
* ([#12](https://github.com/autnmy/issuegraph/issues/12)).
|
|
122
|
+
*
|
|
123
|
+
* So the GUARD reads THIS document, and nothing else does. The deriver and
|
|
124
|
+
* the projection keep reading `landed`, which is what keeps "optimistic
|
|
125
|
+
* re-ordering is not allowed" a property of the structure. The structural
|
|
126
|
+
* refusals keep reading `landed` too, for a different reason: they ask
|
|
127
|
+
* questions the source answers for itself — a duplicate comes back
|
|
128
|
+
* `unchanged`, a vanished edge comes back `rejected` or `unchanged` — and the
|
|
129
|
+
* answer is adopted, so a dispatch the store lets through is what repairs
|
|
130
|
+
* its copy. Refusing those against a document the snapshot cannot show would
|
|
131
|
+
* draw an edge the user can see as `unknown-edge`, with nothing to do but
|
|
132
|
+
* wait for a re-read nothing prompts. A cycle is the question the source
|
|
133
|
+
* does NOT answer — an adapter applies what it is handed — which is why the
|
|
134
|
+
* guard is the one reader that must not be shown the stale copy. Every
|
|
135
|
+
* `adopt` sets both documents; only the conflict arm moves this one alone.
|
|
136
|
+
* The queue runs one authoritative operation at a time, so this is monotone
|
|
137
|
+
* in the order the source answered — no freshness counter, which is the
|
|
138
|
+
* bookkeeping #7 records as wrong three times over.
|
|
139
|
+
*/
|
|
140
|
+
let newest = EMPTY_DOCUMENT;
|
|
107
141
|
let status = 'idle';
|
|
108
142
|
let hydrationError;
|
|
109
143
|
let records = [];
|
|
@@ -113,14 +147,28 @@ export function createStore(config) {
|
|
|
113
147
|
let orderError;
|
|
114
148
|
let sequence = 0;
|
|
115
149
|
/**
|
|
116
|
-
*
|
|
150
|
+
* A derivation the held order still owes, and the newest write that landed
|
|
151
|
+
* while it was held.
|
|
117
152
|
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
153
|
+
* THE ORDER HOLDS FOR THE WHOLE HELD PERIOD, not per write. A change to
|
|
154
|
+
* several issues goes out as several writes, and re-deriving after each
|
|
155
|
+
* landing would move the rows once per write and summarise only the last
|
|
156
|
+
* one. So while any record is `pending`, a document adopted by a landing,
|
|
157
|
+
* an `unchanged` answer or a read only records here that the order is owed;
|
|
158
|
+
* `publish` derives once, when nothing is pending, and diffs against the
|
|
159
|
+
* rows held since the period began. `landing` stays `undefined` when no
|
|
160
|
+
* write landed, because then nothing was saved and there is no summary.
|
|
161
|
+
*
|
|
162
|
+
* `baseline` IS WHAT THE SUMMARY DIFFS AGAINST when somebody else's change
|
|
163
|
+
* was adopted before any write landed: a read, or an `unchanged` answer. The
|
|
164
|
+
* held rows predate that change, so diffing against them would credit its
|
|
165
|
+
* movement to the save. It is derived privately, so the order still holds.
|
|
166
|
+
* A foreign change adopted AFTER a landing in the same period cannot be told
|
|
167
|
+
* apart from the save's own movement, and is counted in its summary.
|
|
168
|
+
* `'underivable'` says the deriver threw on that document, so no order is
|
|
169
|
+
* known to diff against and the period claims no summary.
|
|
122
170
|
*/
|
|
123
|
-
let
|
|
171
|
+
let owed;
|
|
124
172
|
const queue = [];
|
|
125
173
|
let draining = false;
|
|
126
174
|
const listeners = new Set();
|
|
@@ -150,6 +198,9 @@ export function createStore(config) {
|
|
|
150
198
|
edges: sameEdgeSet(landed.edges, next.edges) ? landed.edges : own(next.edges),
|
|
151
199
|
};
|
|
152
200
|
landed = adopted;
|
|
201
|
+
// An authoritative answer supersedes a conflict's upstream: what landed is
|
|
202
|
+
// now the newest thing the source has said.
|
|
203
|
+
newest = adopted;
|
|
153
204
|
}
|
|
154
205
|
/**
|
|
155
206
|
* Rebuild the snapshot, reusing every slice that has not changed, and notify
|
|
@@ -167,6 +218,15 @@ export function createStore(config) {
|
|
|
167
218
|
// how a follow-up edit once jumped the queue ahead of the edit that
|
|
168
219
|
// triggered it. Every other call site already commits first; keep it that
|
|
169
220
|
// way rather than making each one rediscover the rule.
|
|
221
|
+
//
|
|
222
|
+
// Derived here because every transition ends in a publish, so the one that
|
|
223
|
+
// empties the pending set — a settle, a refusal, a restored resolve, a
|
|
224
|
+
// read — cannot be missed by a call site that forgot to ask.
|
|
225
|
+
if (owed !== undefined && !anyPending(records)) {
|
|
226
|
+
const { landing, baseline } = owed;
|
|
227
|
+
owed = undefined;
|
|
228
|
+
reDerive(landing, baseline);
|
|
229
|
+
}
|
|
170
230
|
const nextProjected = project(landed, records, new Set(selection));
|
|
171
231
|
const nextOrderStatus = anyPending(records) ? 'held' : 'settled';
|
|
172
232
|
// One comparison for every slice. Nothing here names a field, so a field
|
|
@@ -233,15 +293,20 @@ export function createStore(config) {
|
|
|
233
293
|
* escape into the dispatch queue, where it would strand every edit behind it.
|
|
234
294
|
* The previously derived rows stand, `orderError` says why they are stale, and
|
|
235
295
|
* no change summary is emitted for an order nobody computed.
|
|
296
|
+
*
|
|
297
|
+
* A SAVE WITH NO SUMMARY CLEARS THE OLD ONE. Left standing, it would sit
|
|
298
|
+
* beside an order that later saves produced, read as the newest save's effect.
|
|
236
299
|
*/
|
|
237
|
-
function reDerive(cause) {
|
|
238
|
-
const previous = rows;
|
|
300
|
+
function reDerive(cause, baseline) {
|
|
301
|
+
const previous = baseline === 'underivable' ? undefined : (baseline ?? rows);
|
|
239
302
|
let next;
|
|
240
303
|
try {
|
|
241
304
|
next = derive(landed);
|
|
242
305
|
}
|
|
243
306
|
catch (thrown) {
|
|
244
307
|
orderError = messageOf(thrown);
|
|
308
|
+
if (cause !== undefined)
|
|
309
|
+
lastChange = undefined;
|
|
245
310
|
return;
|
|
246
311
|
}
|
|
247
312
|
// RECOVERING FROM A STALE BASELINE EMITS NO SUMMARY. While `orderError`
|
|
@@ -252,12 +317,31 @@ export function createStore(config) {
|
|
|
252
317
|
const recovering = orderError !== undefined;
|
|
253
318
|
orderError = undefined;
|
|
254
319
|
rows = ownRows(next);
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
320
|
+
if (cause !== undefined)
|
|
321
|
+
lastChange = recovering || previous === undefined ? undefined : diffOrder(previous, rows, cause);
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Record that `landed` changed, so the order is owed a derivation. A write
|
|
325
|
+
* that landed becomes the period's newest landing; an adoption that is not a
|
|
326
|
+
* landing keeps the one already recorded.
|
|
327
|
+
*/
|
|
328
|
+
function owe(landing) {
|
|
329
|
+
const prior = owed;
|
|
330
|
+
// Only a held period needs one: otherwise `publish` derives at once.
|
|
331
|
+
const foreignFirst = landing === undefined && prior?.landing === undefined && anyPending(records);
|
|
332
|
+
owed = {
|
|
333
|
+
landing: landing ?? prior?.landing,
|
|
334
|
+
baseline: foreignFirst ? privateDerive() : prior?.baseline,
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
/** The order `landed` gives now, without publishing it, or `'underivable'` when the deriver throws. */
|
|
338
|
+
function privateDerive() {
|
|
339
|
+
try {
|
|
340
|
+
return ownRows(derive(landed));
|
|
341
|
+
}
|
|
342
|
+
catch {
|
|
343
|
+
return 'underivable';
|
|
344
|
+
}
|
|
261
345
|
}
|
|
262
346
|
function recordFor(mutationId) {
|
|
263
347
|
return records.find((record) => record.mutationId === mutationId);
|
|
@@ -278,6 +362,12 @@ export function createStore(config) {
|
|
|
278
362
|
/**
|
|
279
363
|
* Why this edit cannot happen — structurally, then by the injected guard.
|
|
280
364
|
*
|
|
365
|
+
* The structural check reads `landed` and the guard reads `newest` — the
|
|
366
|
+
* document the source most recently answered with, which a conflict can
|
|
367
|
+
* make newer than anything landed. The split is deliberate and the note on
|
|
368
|
+
* `newest` says why: the source corrects a structural mistake with an answer
|
|
369
|
+
* the store adopts, and a cycle it never corrects at all.
|
|
370
|
+
*
|
|
281
371
|
* A guard that throws reached no verdict, and an unknown verdict is not
|
|
282
372
|
* permission to write: it refuses, fail-closed, with the thrown message as
|
|
283
373
|
* the reason. Letting it escape would strand the whole dispatch queue behind
|
|
@@ -290,7 +380,7 @@ export function createStore(config) {
|
|
|
290
380
|
if (guard === undefined)
|
|
291
381
|
return undefined;
|
|
292
382
|
try {
|
|
293
|
-
return guard({ mutation, current:
|
|
383
|
+
return guard({ mutation, current: newest, next: nextDocument(newest, mutation) });
|
|
294
384
|
}
|
|
295
385
|
catch (thrown) {
|
|
296
386
|
return { code: 'guard-failed', message: messageOf(thrown) };
|
|
@@ -319,7 +409,7 @@ export function createStore(config) {
|
|
|
319
409
|
case 'applied': {
|
|
320
410
|
adopt(result.document);
|
|
321
411
|
dropRecord(mutation.mutationId);
|
|
322
|
-
|
|
412
|
+
owe(mutation);
|
|
323
413
|
break;
|
|
324
414
|
}
|
|
325
415
|
case 'unchanged': {
|
|
@@ -327,12 +417,12 @@ export function createStore(config) {
|
|
|
327
417
|
// document — and often said BECAUSE the store is out of date, which is
|
|
328
418
|
// exactly when not adopting it loses an edge that genuinely exists.
|
|
329
419
|
//
|
|
330
|
-
//
|
|
420
|
+
// Owed with NO landing: whatever moved was somebody else's doing, so
|
|
331
421
|
// attributing it to this edit would be wrong. `adopt` no-ops when the
|
|
332
422
|
// document already matches, so the ordinary case changes nothing.
|
|
333
423
|
adopt(result.document);
|
|
334
424
|
dropRecord(mutation.mutationId);
|
|
335
|
-
|
|
425
|
+
owe(undefined);
|
|
336
426
|
break;
|
|
337
427
|
}
|
|
338
428
|
case 'rejected': {
|
|
@@ -345,15 +435,15 @@ export function createStore(config) {
|
|
|
345
435
|
break;
|
|
346
436
|
}
|
|
347
437
|
case 'conflict': {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
438
|
+
// Taken on rather than retained by reference: it is exposed through
|
|
439
|
+
// `snapshot.writes`, so a consumer must not be able to edit the
|
|
440
|
+
// adapter's own arrays through it.
|
|
441
|
+
const upstream = ownDocument(result.upstream);
|
|
442
|
+
putRecord({ mutationId: mutation.mutationId, mutation, state: 'conflict', upstream });
|
|
443
|
+
// NOT adopted — `landed` and the order stay where they are. But it is
|
|
444
|
+
// the newest document the source has answered with, so it is what the
|
|
445
|
+
// guard is next shown, until an answer that lands replaces it.
|
|
446
|
+
newest = upstream;
|
|
357
447
|
break;
|
|
358
448
|
}
|
|
359
449
|
}
|
|
@@ -367,28 +457,35 @@ export function createStore(config) {
|
|
|
367
457
|
* a fact about the adapter not being called, not just about the colour of the
|
|
368
458
|
* edge, and that is what the tests assert.
|
|
369
459
|
*/
|
|
370
|
-
function start(
|
|
371
|
-
|
|
372
|
-
// until the next edit or an explicit dismissal. Clearing it here is what
|
|
373
|
-
// makes that true: left standing, a host would show the previous edit's
|
|
374
|
-
// blast radius beside the edit the user is making now.
|
|
375
|
-
lastChange = undefined;
|
|
376
|
-
currentProposal = mutation.mutationId;
|
|
460
|
+
function start(task) {
|
|
461
|
+
const { mutation } = task;
|
|
377
462
|
const settled = new Promise((resolve) => settlers.set(mutation.mutationId, resolve));
|
|
378
|
-
|
|
463
|
+
// THE VERDICT IS REACHED AGAINST THE DOCUMENT THE EDIT WILL BE DISPATCHED
|
|
464
|
+
// AGAINST. For a direct dispatch that is `landed` as it stands, so a refused
|
|
465
|
+
// edit is recorded here and never enters the queue. For a resolve it is the
|
|
466
|
+
// document the refresh will confirm, which does not exist yet — asking now
|
|
467
|
+
// would refuse or admit the edit on the very copy the user asked to look
|
|
468
|
+
// past. Its verdict waits for the queue's re-check, where every edit is
|
|
469
|
+
// asked again anyway.
|
|
470
|
+
const refusal = task.kind === 'dispatch' ? refusalFor(mutation) : undefined;
|
|
379
471
|
if (refusal !== undefined) {
|
|
380
472
|
putRecord({ mutationId: mutation.mutationId, mutation, state: 'invalid', reason: refusal });
|
|
381
473
|
settle(mutation.mutationId);
|
|
382
474
|
publish();
|
|
383
475
|
return { mutationId: mutation.mutationId, settled };
|
|
384
476
|
}
|
|
477
|
+
// THIS IS THE RESERVATION, for a resolve as much as for a dispatch. A
|
|
478
|
+
// `pending` record is one `discardMine` and `retry` decline to touch, so
|
|
479
|
+
// from here until the edit settles nothing can act on it — including across
|
|
480
|
+
// the refresh a resolve is about to wait on. That is what lets the store
|
|
481
|
+
// own a resolution that spans an await: the intent was captured before it.
|
|
385
482
|
putRecord({ mutationId: mutation.mutationId, mutation, state: 'pending' });
|
|
386
483
|
// ENQUEUE BEFORE NOTIFYING. `publish` runs subscribers synchronously, so a
|
|
387
484
|
// subscriber proposing a follow-up re-enters here — and if the queue does
|
|
388
485
|
// not yet hold this edit, the nested one takes its place in line and goes
|
|
389
486
|
// out first. Two edits on the same edge then apply in the reverse of the
|
|
390
487
|
// order the user made them.
|
|
391
|
-
queue.push(
|
|
488
|
+
queue.push(task);
|
|
392
489
|
publish();
|
|
393
490
|
void drain();
|
|
394
491
|
return { mutationId: mutation.mutationId, settled };
|
|
@@ -397,12 +494,13 @@ export function createStore(config) {
|
|
|
397
494
|
* Run the queue, one authoritative operation at a time — dispatches and
|
|
398
495
|
* document reads alike, since both answer with a document.
|
|
399
496
|
*
|
|
400
|
-
* An edit that WAITED is re-checked before it goes out, because
|
|
401
|
-
* have moved under it — a sibling edit can delete the relationship this
|
|
402
|
-
* retypes, and
|
|
403
|
-
*
|
|
404
|
-
*
|
|
405
|
-
*
|
|
497
|
+
* An edit that WAITED is re-checked before it goes out, because the document
|
|
498
|
+
* may have moved under it — a sibling edit can delete the relationship this
|
|
499
|
+
* one retypes, and a sibling's CONFLICT can carry an upstream that closes a
|
|
500
|
+
* cycle with it — and dispatching against a document that no longer admits
|
|
501
|
+
* it would defeat "refused before any write". Every edit is re-checked here
|
|
502
|
+
* whether or not it waited; the comment at the check says why. A resolve is
|
|
503
|
+
* checked here for the FIRST time, against the document its read confirmed.
|
|
406
504
|
*/
|
|
407
505
|
async function drain() {
|
|
408
506
|
if (draining)
|
|
@@ -411,10 +509,34 @@ export function createStore(config) {
|
|
|
411
509
|
try {
|
|
412
510
|
for (let next = queue.shift(); next !== undefined; next = queue.shift()) {
|
|
413
511
|
if (next.kind === 'load') {
|
|
414
|
-
|
|
512
|
+
const ok = await runLoad(next.first);
|
|
513
|
+
publish();
|
|
514
|
+
next.done(ok);
|
|
415
515
|
continue;
|
|
416
516
|
}
|
|
517
|
+
if (next.kind === 'resolve') {
|
|
518
|
+
const ok = await runLoad(false);
|
|
519
|
+
if (!ok) {
|
|
520
|
+
// THE READ FAILED, SO NOTHING IS CONFIRMED, and the edit does not
|
|
521
|
+
// go out: the `continue` below is what makes the two halves one
|
|
522
|
+
// operation. The record goes back to exactly what it was when the
|
|
523
|
+
// resolution was reserved — a conflict keeps its `upstream` for
|
|
524
|
+
// view-diff — and `hydrationError`, set by the read, says why. Not
|
|
525
|
+
// downgraded to `failed`: that would throw away the one document
|
|
526
|
+
// the user can still compare against.
|
|
527
|
+
putRecord(next.prior);
|
|
528
|
+
settle(next.mutation.mutationId);
|
|
529
|
+
}
|
|
530
|
+
// ONE TRANSITION, whichever way the read went. The restore rides the
|
|
531
|
+
// same publish as the read's outcome, so no subscriber can observe
|
|
532
|
+
// "refresh failed, edit still in flight" as a state of its own.
|
|
533
|
+
publish();
|
|
534
|
+
if (!ok)
|
|
535
|
+
continue;
|
|
536
|
+
}
|
|
417
537
|
// ALWAYS re-checked, not only when something is known to have moved.
|
|
538
|
+
// For a resolve this is the FIRST check, and against the document the
|
|
539
|
+
// read just confirmed — which is the point of resolving.
|
|
418
540
|
// Knowing that needs bookkeeping about document freshness, and every
|
|
419
541
|
// version of that bookkeeping this store has had was wrong in a way
|
|
420
542
|
// nobody could see. `refusalFor` is pure and cheap; asking it twice
|
|
@@ -449,8 +571,16 @@ export function createStore(config) {
|
|
|
449
571
|
function noop(mutationId) {
|
|
450
572
|
return { mutationId, settled: Promise.resolve() };
|
|
451
573
|
}
|
|
452
|
-
/**
|
|
453
|
-
|
|
574
|
+
/**
|
|
575
|
+
* Read the document. Only ever called from the queue. Resolves `true` when
|
|
576
|
+
* the read succeeded.
|
|
577
|
+
*
|
|
578
|
+
* PUBLISHES NOTHING AT THE END, on purpose: the caller decides what else
|
|
579
|
+
* belongs in the same transition. A resolve whose read failed restores its
|
|
580
|
+
* record before publishing, so the outcome of the read and the restored edit
|
|
581
|
+
* arrive together. (The `hydrating` publish on a first load is a transition
|
|
582
|
+
* of its own, before the read starts.)
|
|
583
|
+
*/
|
|
454
584
|
async function runLoad(first) {
|
|
455
585
|
if (first) {
|
|
456
586
|
status = 'hydrating';
|
|
@@ -462,7 +592,7 @@ export function createStore(config) {
|
|
|
462
592
|
adopt(document);
|
|
463
593
|
status = 'ready';
|
|
464
594
|
hydrationError = undefined;
|
|
465
|
-
|
|
595
|
+
owe(undefined);
|
|
466
596
|
}
|
|
467
597
|
catch (thrown) {
|
|
468
598
|
hydrationError = messageOf(thrown);
|
|
@@ -470,10 +600,8 @@ export function createStore(config) {
|
|
|
470
600
|
// first load that never produced one reports `failed`.
|
|
471
601
|
if (first)
|
|
472
602
|
status = 'failed';
|
|
473
|
-
publish();
|
|
474
603
|
return false;
|
|
475
604
|
}
|
|
476
|
-
publish();
|
|
477
605
|
return true;
|
|
478
606
|
}
|
|
479
607
|
return {
|
|
@@ -495,19 +623,26 @@ export function createStore(config) {
|
|
|
495
623
|
// A per-store counter, not a random identifier: identities only have to
|
|
496
624
|
// be unique within one store, and a deterministic one keeps every test
|
|
497
625
|
// that reads a mutation id reproducible.
|
|
498
|
-
return start({ ...proposal, mutationId: `m${sequence}` });
|
|
626
|
+
return start({ kind: 'dispatch', mutation: { ...proposal, mutationId: `m${sequence}` } });
|
|
499
627
|
},
|
|
500
628
|
retry(mutationId) {
|
|
501
629
|
const record = recordFor(mutationId);
|
|
502
630
|
if (record === undefined || record.state === 'pending')
|
|
503
631
|
return noop(mutationId);
|
|
504
|
-
return start(record.mutation);
|
|
632
|
+
return start({ kind: 'dispatch', mutation: record.mutation });
|
|
633
|
+
},
|
|
634
|
+
retryOnLatest(mutationId) {
|
|
635
|
+
const record = recordFor(mutationId);
|
|
636
|
+
if (record === undefined || record.state === 'pending')
|
|
637
|
+
return noop(mutationId);
|
|
638
|
+
return start({ kind: 'resolve', mutation: record.mutation, prior: record });
|
|
505
639
|
},
|
|
506
640
|
/**
|
|
507
641
|
* Single-step on purpose: it reads the record and acts on it with no
|
|
508
|
-
* `await` in between, so nothing can change underneath it.
|
|
509
|
-
* that
|
|
510
|
-
*
|
|
642
|
+
* `await` in between, so nothing can change underneath it. The resolution
|
|
643
|
+
* that has to refresh first gets the same property by reserving the edit
|
|
644
|
+
* BEFORE its refresh — the record is `pending` from that call on, which is
|
|
645
|
+
* exactly the state this declines to touch.
|
|
511
646
|
*/
|
|
512
647
|
discardMine(mutationId) {
|
|
513
648
|
const record = recordFor(mutationId);
|
package/dist/store.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAKL,WAAW,GACZ,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAoB,SAAS,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAwC,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACvF,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AA4GhE,6EAA6E;AAC7E,6EAA6E;AAC7E,SAAS;AACT,MAAM,cAAc,GAAkB,MAAM,CAAC,MAAM,CAAC;IAClD,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;CACzB,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAS,GAAG,CAAI,IAAkB;IAChC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AAClC,CAAC;AAED,mFAAmF;AACnF,SAAS,WAAW,CAAC,QAAuB;IAC1C,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,QAAQ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
|
package/dist/validity.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* belongs with the derivation so the package family has one of it. Both halves
|
|
12
12
|
* produce the same refusal, and neither ever reaches `dispatch`.
|
|
13
13
|
*/
|
|
14
|
-
import { isSymmetricEdgeField } from '@issuegraph/core';
|
|
14
|
+
import { EDGE_CARDINALITY, isSymmetricEdgeField } from '@issuegraph/core';
|
|
15
15
|
import { findEdge, hasIssue, makeEdge, } from "./model.js";
|
|
16
16
|
/** The edge an edit produces, or `undefined` for one that produces none. */
|
|
17
17
|
export function resultingEdge(document, mutation) {
|
|
@@ -74,6 +74,45 @@ export function nextDocument(document, mutation) {
|
|
|
74
74
|
function refuse(code, message) {
|
|
75
75
|
return { code, message };
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Why this edit would give a single-valued field a second reference (§4.3).
|
|
79
|
+
*
|
|
80
|
+
* `blocked-by` is the only list; every other relationship field holds ONE
|
|
81
|
+
* reference, because a writer joins a group or names a canonical by pointing
|
|
82
|
+
* at one member. Two references is not a richer document but an ambiguous one
|
|
83
|
+
* — a reader resolves it by whichever it saw last.
|
|
84
|
+
*
|
|
85
|
+
* Asked of the RESULTING edge rather than of the operation, so a retype into an
|
|
86
|
+
* occupied field, and a flip whose new carrier is occupied, are refused exactly
|
|
87
|
+
* like a create — and the edge a retype or flip REPLACES is excluded, because
|
|
88
|
+
* it is on its way out. The carrier is `from` as written, for the symmetric
|
|
89
|
+
* kinds too: the field lives on one issue's frontmatter, and joining a group
|
|
90
|
+
* from a free carrier is how a writer joins one.
|
|
91
|
+
*
|
|
92
|
+
* It lives HERE, beside the other structural refusals, and not in a host's
|
|
93
|
+
* guard or adapter. It needs the edit and the document and no graph walk, which
|
|
94
|
+
* is this file's criterion, and the vocabulary it reads is the one
|
|
95
|
+
* `@issuegraph/core` already fixes. A rule enforced at a call site covers one
|
|
96
|
+
* route to a write and misses `retry` and the queued re-check; one enforced by
|
|
97
|
+
* an adapter comes back `failed` — "refused upstream" — on a write that never
|
|
98
|
+
* left the client (issue #11). A structural refusal reaches every route.
|
|
99
|
+
*/
|
|
100
|
+
function cardinalityRefusal(document, mutation) {
|
|
101
|
+
const resulting = resultingEdge(document, mutation);
|
|
102
|
+
if (resulting === undefined || EDGE_CARDINALITY[resulting.kind] !== 'single')
|
|
103
|
+
return undefined;
|
|
104
|
+
const replaced = mutation.op === 'create' ? undefined : mutation.edgeId;
|
|
105
|
+
// `resulting.id` is never held by the time this runs — the duplicate refusal
|
|
106
|
+
// went first — but excluding it keeps this function true on its own rather
|
|
107
|
+
// than true because of the order `structuralRefusal` happens to call it in.
|
|
108
|
+
const held = document.edges.find((edge) => edge.kind === resulting.kind &&
|
|
109
|
+
edge.from === resulting.from &&
|
|
110
|
+
edge.id !== resulting.id &&
|
|
111
|
+
edge.id !== replaced);
|
|
112
|
+
if (held === undefined)
|
|
113
|
+
return undefined;
|
|
114
|
+
return refuse('cardinality', `${held.from} already carries ${held.kind} ${held.to}, and ${held.kind} holds one reference.`);
|
|
115
|
+
}
|
|
77
116
|
/**
|
|
78
117
|
* Why this edit cannot happen, from the edit and the document alone.
|
|
79
118
|
*
|
|
@@ -94,7 +133,7 @@ export function structuralRefusal(document, mutation) {
|
|
|
94
133
|
if (findEdge(document, produced.id) !== undefined) {
|
|
95
134
|
return refuse('duplicate-edge', `${mutation.from} is already ${mutation.kind} ${mutation.to}.`);
|
|
96
135
|
}
|
|
97
|
-
return
|
|
136
|
+
return cardinalityRefusal(document, mutation);
|
|
98
137
|
}
|
|
99
138
|
const edge = findEdge(document, mutation.edgeId);
|
|
100
139
|
if (edge === undefined) {
|
|
@@ -120,6 +159,6 @@ export function structuralRefusal(document, mutation) {
|
|
|
120
159
|
if (produced !== undefined && produced.id !== edge.id && findEdge(document, produced.id) !== undefined) {
|
|
121
160
|
return refuse('duplicate-edge', `${produced.from} is already ${produced.kind} ${produced.to}.`);
|
|
122
161
|
}
|
|
123
|
-
return
|
|
162
|
+
return cardinalityRefusal(document, mutation);
|
|
124
163
|
}
|
|
125
164
|
//# sourceMappingURL=validity.js.map
|
package/dist/validity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validity.js","sourceRoot":"","sources":["../src/validity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"validity.js","sourceRoot":"","sources":["../src/validity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAE1E,OAAO,EAIL,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,MAAM,YAAY,CAAC;AAmBpB,4EAA4E;AAC5E,MAAM,UAAU,aAAa,CAAC,QAAuB,EAAE,QAAkB;IACvE,QAAQ,QAAQ,CAAC,EAAE,EAAE,CAAC;QACpB,KAAK,QAAQ;YACX,OAAO,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;QAC7D,KAAK,QAAQ;YACX,OAAO,SAAS,CAAC;QACnB,KAAK,QAAQ,CAAC,CAAC,CAAC;YACd,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;YACjD,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1F,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,CAAC;YACZ,MAAM,IAAI,GAAG,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;YACjD,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,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MAAM,CAAC,gBAAgB,EAAE,GAAG,IAAI,CAAC,IAAI,qDAAqD,CAAC,CAAC;QACrG,CAAC;QACD,IAAI,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE,EAAE,CAAC;YAC1B,OAAO,MAAM,CAAC,WAAW,EAAE,kEAAkE,CAAC,CAAC;QACjG,CAAC;IACH,CAAC;IAED,MAAM,QAAQ,GAAG,aAAa,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACnD,6EAA6E;IAC7E,yEAAyE;IACzE,4DAA4D;IAC5D,IAAI,QAAQ,KAAK,SAAS,IAAI,QAAQ,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE,IAAI,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC,KAAK,SAAS,EAAE,CAAC;QACvG,OAAO,MAAM,CAAC,gBAAgB,EAAE,GAAG,QAAQ,CAAC,IAAI,eAAe,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,EAAE,GAAG,CAAC,CAAC;IAClG,CAAC;IACD,OAAO,kBAAkB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAChD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@issuegraph/store",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "A framework-free client store for an Issuegraph document, plus the data-source port a host plugs its tracker into. Renders edits optimistically, dispatches every mutation outward, and never re-evaluates the selection order until the write lands.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"issuegraph",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"node": ">=18"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@issuegraph/core": "^0.1.
|
|
45
|
+
"@issuegraph/core": "^0.1.3"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/node": "^22.18.0",
|