Contentful logo

Contentful Community

Not getting Deleted Entry?

#1

Our content manager removed a bunch of entries between sync. It doesn’t seem like we got any DeleteEntries in our Items array. If items are removed form the space and not archived should we get a DeletedEntry item?

Verified that we are not getting deletes between syncs. The items have been completely removed from contentful.

The initial sync is a sync all.

#2

Hey @scott.andrew,

if you specified the initial sync to be of type all, you should indeed get DeletedEntry entities in subsequent syncs. :thinking:

Were the removed entries published before? As the Sync API operates on published data only (it’s under cdn.contentful.com) un-publishing an entry is considered a “deletion”. So no DeletedEntry if you fully remove an entity from Contentful.
If you’re interested in notifications for this, I can recommend our Webhooks, as they operate on the management API. You’d need to subscribe to the topic *.delete to get notified about any deletion of content types, assets & entries.

In case you can’t reproduce the issue on a different space & think this behavior is bound to your space, I’d kindly ask you to open a support ticket, so we can have a closer look.

Best,
Stephan

1 Like
#3

@stephan.schneider

One more question regarding this. If an object is moved back to draft. What what would happen the entry. We had an entry or two go from back the draft state from the published state. Would those get deleted events or become orphaned in the sync API?

#4

Hey @scott.andrew,

When you unpublish an entry (moving it back to draft) it gets removed from our delivery API, so it won’t be reachable via cdn.contentful.com anymore. At the same time you should get it served as a DeletedEntry in the Sync API.

It will stay available in the preview & management APIs, so that you can do changes to the entry and publish it again, if needed.

Does that make sense in context of your question?

Best,
Stephan

#5

So our draft items are still getting served as items. I can see them as drafts online but they are not getting marked as deleted and are still coming down in sync for a new client using the next sync URL that was provided when we built our database.

In the JSON for the initial sync I am finding:

[“fields”: {
director = {
“en-US” = dhlovelife;
};
live = {
“en-US” = 1;
};
liveDate = {
“en-US” = “2018-07-03T10:00-07:00”;
};
time = {
“en-US” = LIVE;
};
title = {
“en-US” = “NEIL YOUNG SOLO - DETROIT FOX THEATER”;
};
videoID = {
“en-US” = 278195264;
};
}, “sys”: {
contentType = {
sys = {
id = movieNightFilm;
linkType = ContentType;
type = Link;
};
};
createdAt = “2018-07-03T17:51:53.906Z”;
environment = {
sys = {
id = master;
linkType = Environment;
type = Link;
};
};
id = 5rve9Xqz5Y8w6CE4ceMSWa;
revision = 1;
space = {
sys = {
id = 2okapnzdylk2;
linkType = Space;
type = Link;
};
};
type = Entry;
updatedAt = “2018-07-04T02:50:02.745Z”;
}]

#6

That’s weird indeed. Could you please reach out to our support mentioning your space ID and this thread here? This does indeed not look like the expected behavior. :frowning:

#7

After talking to our backend guys its figured out they are using the preview keys around the proxy they gave me. Thank you very much. By the way. The sync api rocks.

#8

Hi,
I have the same issue with Preview Content API (in Java). Sync API picks up additions and updates, but never deletions, no matter what SyncType I set.

Serge

Sync API - deleted entities not coming through with Java SDK