N
Novu8mo ago
dmgarland

Digest Amount does not exist on a digest job

I'm seeing this quite a bit in our logs { "level": 40, "time": 1699023328422, "pid": 17, "serviceName": "@novu/worker", "serviceVersion": "0.17.1", "platform": "Docker", "tenant": "OS", "transactionId": "017425c5-2225-413b-8fdc-a0ef35a9b073", "environmentId": "64c7dbbd0b825551a56889d7", "organizationId": "64c7dbbc0b825551a56889ab", "jobId": "654509cff7875593d0377b9f", "msg": "Digest Amount does not exist on a digest job" } What does it mean? Is there an action on us for these?
22 Replies
Pawan Jain
Pawan Jain7mo ago
Is amount set up correctly on digest ?
dmgarland
dmgarland7mo ago
Yes. I can see in the app and also in the database that the template referred to in the job has the digest amount, e, g.
{
active: true,
shouldStopOnFail: false,
uuid: '0f253ea3-fda4-46ed-8a85-4d17c80f4c4a',
name: 'Digest',
filters: [],
_templateId: ObjectId("65291d6254ba09c9a57e0d76"),
_parentId: null,
metadata: {
amount: 1,
unit: 'days',
type: 'regular',
backoffAmount: null,
backoff: false,
timed: { weekDays: [], monthDays: [] }
},
_id: ObjectId("652830f5249949fba2ab0e23")
}
{
active: true,
shouldStopOnFail: false,
uuid: '0f253ea3-fda4-46ed-8a85-4d17c80f4c4a',
name: 'Digest',
filters: [],
_templateId: ObjectId("65291d6254ba09c9a57e0d76"),
_parentId: null,
metadata: {
amount: 1,
unit: 'days',
type: 'regular',
backoffAmount: null,
backoff: false,
timed: { weekDays: [], monthDays: [] }
},
_id: ObjectId("652830f5249949fba2ab0e23")
}
But interestingly, the job document in question doesn't seem to have persisted this data, it shows blank
digest: { events: [], timed: { weekDays: [], monthDays: [] } },
digest: { events: [], timed: { weekDays: [], monthDays: [] } },
Is this a bug? Can I patch the document records with digest data to fix this?
Pawan Jain
Pawan Jain7mo ago
@Engineering
DavidSouthmountain
Are you using multiple digest in the workflow?
dmgarland
dmgarland7mo ago
@David no
DavidSouthmountain
if you could share some more about how the workflow looks because I fixed a bug for this yesterday so it should be fixed in next release but I would like to make sure that it fix your case as well
dmgarland
dmgarland7mo ago
So this is the associated notification template (workflow) I'm seeing other errors with other workflows too, not just this one. What was the fix you alluded to?
dmgarland
dmgarland7mo ago
Any ideas? still seeing this a lot
DavidSouthmountain
So the fix I did was that the digest object was changed when we save the digested events and with my fix we only save the events on the current digest object and not change hte whole object
dmgarland
dmgarland7mo ago
so I'd need to upgrade to fix?
DavidSouthmountain
when the fix is released you will have to update yes or if you are running it locally in main it should work for you now
dmgarland
dmgarland7mo ago
so what effect will this have? Does it mean that these jobs are failing and not sending anything?
DavidSouthmountain
your stop on fail is false it should do next step but I am guessing that you are using the digested data in your in app notification?
dmgarland
dmgarland7mo ago
yes
DavidSouthmountain
so then the in app notification will fail as well I think
dmgarland
dmgarland7mo ago
I'm checking for step.total_count in the in-app with a control statement so I'm assuming that will still work... but it's going to be a huge problem for us if we're not digesting and sending loads of individual notifications.
Novu_Bot
Novu_Bot7mo ago
@dmgarland, you just advanced to level 4!
dmgarland
dmgarland7mo ago
Sounds like it's important to set 'stop on fail' to false for digests? What's the behaviour? We're using the digest to stop poeple being flooded...
DavidSouthmountain
that if the digest step fails it will continue to next step but your message may not look as intended because all the digested information is not there and the events that was supposed to be digest will not be sent. @Paweł T. @Dima Grossman maybe we should patch out my fix for this?
dmgarland
dmgarland7mo ago
But could you confirm that unless I manually set 'stop on fail' we're effectively not digesting and spamming in-apps? I don't see 'stop on fail' for digest step in the app, so I'd need to do this at the DB level?
DavidSouthmountain
You will not spam them because the other events will still think they will be digested.