@anchrd/intel-api 0.37.0 → 0.37.1
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/dist/adapters/db/db-feed.js +12 -0
- package/package.json +1 -1
|
@@ -76,6 +76,17 @@ function parseMetadata(raw) {
|
|
|
76
76
|
* exist. Both halves fall back on the metadata `parentId` for the one event whose row is gone.
|
|
77
77
|
*/
|
|
78
78
|
const FLOW_PARENT = "COALESCE(flow.parent_id, json_extract(e.metadata_json, '$.parentId'))";
|
|
79
|
+
// ⚠️ A card whose title is NULL names nothing, and `FeedEvent.resourceTitle` refuses it — the reader
|
|
80
|
+
// gets a validation error instead of a feed. It is a real state and not a theoretical one (#763,
|
|
81
|
+
// found against the running installation): an ADMIN passes `flowInSubtree` on its first branch
|
|
82
|
+
// alone, so events about a flow whose row is gone reach this far, and only `flows.purge` carries a
|
|
83
|
+
// title in its metadata. `flows.create` and `flows.archive` carry none, and there is nothing left
|
|
84
|
+
// to read one from.
|
|
85
|
+
//
|
|
86
|
+
// ⚠️ The node half cannot reach this state, and that asymmetry is the whole reason it was missed:
|
|
87
|
+
// there the check is `COALESCE(n.id, …) IN (SELECT id FROM allowed)`, a join against real rows with
|
|
88
|
+
// no admin short-circuit in front of it, so a deleted node's events drop out on their own.
|
|
89
|
+
const HAS_TITLE = "COALESCE(n.title, flow.title, json_extract(e.metadata_json, '$.title')) IS NOT NULL";
|
|
79
90
|
const NODE_PARENT = "COALESCE(n.id, json_extract(e.metadata_json, '$.parentId'))";
|
|
80
91
|
export const feedPageQuery = `${subtreeCte}
|
|
81
92
|
SELECT e.id, e.actor_id, e.action, e.resource_id,
|
|
@@ -98,6 +109,7 @@ export const feedPageQuery = `${subtreeCte}
|
|
|
98
109
|
AND ${flowInSubtreeOver(FLOW_PARENT)}
|
|
99
110
|
)
|
|
100
111
|
)
|
|
112
|
+
AND ${HAS_TITLE}
|
|
101
113
|
AND (? IS NULL OR e.actor_id = ?)
|
|
102
114
|
AND (
|
|
103
115
|
? IS NULL
|