-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: improve error messaging #893
Conversation
@@ -180,7 +188,13 @@ export function getAllTaggedElements({ | |||
for (const { node, text } of stegaNodes) { | |||
const sourceMap = decode(text); | |||
if (!sourceMap || !sourceMap.origin.includes('contentful.com')) { | |||
debug.warn; | |||
debug.warn( | |||
"Element has missing or invalid ContentSourceMap, please check if you have correctly enabled ContentSourceMaps and that the element's data originates from Contentful", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MayaGillilan are we trying to imply that the data shouldn't be transformed once it comes from our APIs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have to admit I'm not as familiar with CSM so that was my understanding, but if that's an inaccurate description please let me know what would be more accurate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@2wce @YvesRijckaert Can you confirm if this is an appropriate message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -34,6 +34,17 @@ export class LiveUpdates { | |||
|
|||
const subscription = this.subscriptions.get(subscriptionId); | |||
|
|||
if (!data.sys || !data.sys.id) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MayaGillilan Just as an FYI: this broke live updates for GraphQL:
data
could look like this for GraphQL:
{
"postCollection": {
"items": [
{
"__typename": "Post",
"sys": {
"id": "a1b2c3"
},
"slug": "foo",
"title": "new value",
]
}
]
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes debug messaging more explicit and meaningful, so as to make configuration issues and user debugging easier