Repository navigation
m2m_connected_content coalesce key (catalog_item, topic) makes Knowledge and Quick Link connections impossible to declare in Fluent #98
Unanswered
chasingtheflow
asked this question in
Help and Questions with SDK or Fluent
Replies: 2 comments
|
FYI this is still an issue in 4.11 |
0 replies
|
Yes, we ran into some issues with this, and are trying to fix this with 4.12 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
SDK version: @servicenow/sdk 4.8.0 (also reproduced on 4.8.1), global-scope app
Summary
The SDK seems to hardcode record identity for m2m_connected_content as coalesce: ["catalog_item", "topic"]. This table is polymorphic — the content reference lives in catalog_item, knowledge, or quick_link depending on content_type. For Knowledge and Quick Link connections catalog_item is empty, so all such records connected to the same topic collapse into one composite identity (NULL, topic), and the build rejects the project.
Steps to reproduce
export const conn1 = Record({
$id: Now.ID['kb-conn-1'],
table: 'm2m_connected_content',
data: {
content_type: '',
knowledge: '<kb_knowledge sys_id A>',
topic: '',
},
});
export const conn2 = Record({
$id: Now.ID['kb-conn-2'],
table: 'm2m_connected_content',
data: {
content_type: '',
knowledge: '<kb_knowledge sys_id B>', // different article
topic: '', // same topic
},
});
Expected: two records (this is valid, common ESC data).
Actual: build error — the sdk thinks, wrongly, that the same record is defined 2 times. The distinct Now.ID keys are ignored because composite-key resolution takes precedence for coalesce-configured tables; explicit keys.ts entries cannot override it.
Additional impact: now-sdk transform has the inverse problem ontent rows with empty catalog_item are matched to anyexisting keys.ts composite entry with the same (NULL, topic) tuple, mis-mapping unrelated Knowledge/Quick Link connections onto each other's sys_ids.
Suggested fix
Make the coalesce definition content-type aware, e.g. ["conte"knowledge", "quick_link", "topic"], or fall back to explicit$id identity when the configured coalesce fields are empty/NULL.
All reactions