You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ContentfulLivePreview.subscribe (and useContentfulLiveUpdates) return the following error when attempting to subscribe to a REST API entry that contains a circular reference.
[Live Preview]: Invalid live updates subscription detected.
Please keep in mind that the data provided to the live updates needs to have "sys.id", "fields" for REST or the "__typename" for GraphQL on the data structure.
The data object provided is not transformed and does have both sys.id and fields properties as can been seen in the error message itself:
This issue may be a problem with the CMS console endpoint that handles the subscription requests, not this codebase.
To Reproduce
Steps to reproduce the behavior:
Create a content model with a reference field.
Create two entries using the model, each with references to the other.
Create a web page that uses useContentfulLiveUpdates or ContentfulLivePreview.subscribe to subscribe to the REST data for one of those entries
Open page within live preview
Change content data -> data does not update in live preview frame
View browser log. Notice warning noted above.
Expected behavior
No console warning. Live update to data on page in live preview frame.
Context (please complete the following information):
Live preview SDK version number: 4.5.3
REST / GraphQL API: REST
Next 14 using app router
The text was updated successfully, but these errors were encountered:
dndrsn
changed the title
"Invalid live updates subscription detected" Error using REST data
"Invalid live updates subscription detected" error if the same entry ID is encountered more than once.
Aug 22, 2024
dndrsn
changed the title
"Invalid live updates subscription detected" error if the same entry ID is encountered more than once.
useContentfulLiveUpdates "Invalid live updates subscription detected" error - REST API
Aug 22, 2024
On further investigation, useContentfulLiveUpdates and ContentfulLivePreview.subscribe return the error if the entry being subscribed to contains a circular reference. For example if an entry has a reference to another entry and that entry has a reference to the original entry. The reference can be via a reference(s) type field or via a entry link within a rich text field.
Updating the issue title and description updated (again).
dndrsn
changed the title
useContentfulLiveUpdates "Invalid live updates subscription detected" error - REST API
"Invalid live updates subscription detected" error if entry contains circular entry reference - REST API
Aug 23, 2024
Describe the bug
ContentfulLivePreview.subscribe
(anduseContentfulLiveUpdates
) return the following error when attempting to subscribe to a REST API entry that contains a circular reference.The data object provided is not transformed and does have both
sys.id
andfields
properties as can been seen in the error message itself:This issue may be a problem with the CMS console endpoint that handles the subscription requests, not this codebase.
To Reproduce
Steps to reproduce the behavior:
useContentfulLiveUpdates
orContentfulLivePreview.subscribe
to subscribe to the REST data for one of those entriesExpected behavior
No console warning. Live update to data on page in live preview frame.
Context (please complete the following information):
The text was updated successfully, but these errors were encountered: