strapi-community / strapi-plugin-publisher

A plugin for Strapi Headless CMS that provides the ability provides the ability to easily schedule publishing and unpublishing of any content type.
https://market.strapi.io/plugins/strapi-plugin-publisher
MIT License
48 stars 17 forks source link

Async error in server's console #69

Closed DaDlugosch closed 1 year ago

DaDlugosch commented 1 year ago

Hi, when I have started using this plugin, I encountered these error messages in server's console. It always happens every minute while application is running. Could you please look at it? I'm overloading my Sentry dashboard with these weird errors. However, in Strapi administration everything looks correct. Even publishing works as expected.

This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
TypeError: Cannot read properties of null (reading 'publishedAt')
    at Object.toggle (/Users/test-user/Sites/rkckk/web.com/node_modules/strapi-plugin-publisher/server/services/publication-service.js:61:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Thanks.

ComfortablyCoding commented 1 year ago

That should only occur if the records don't exist which is not expected to happen. I will add a guard for it but strange that it is occuring.

Do you have reproducible steps for this to occur?

ComfortablyCoding commented 1 year ago

This should be fixed in v1.3.4 (latest release)