Our powerful JS Calendar component


Post by parl@nuviasmiles.com »

Getting an error I don't understand. Crashing on the following function on this line (const h = l.storage.findItem("eventId", e.id);), including an image:

        processRecord(e, i=!1) {
            var n, s;
            e = super.processRecord(e, i);
            const a = this
              , l = (s = a.assignmentStore) != null ? s : (n = a.crudManager) == null ? void 0 : n.assignmentStore
              , o = e.get("resourceId")
              , {resourceIds: d} = e;
            if (d != null && d.length && e.meta.skipEnforcingSingleAssignment !== !1 && a.usesResourceIds)
                l ? l.add(d.filter(c=>!l.some(u=>u.eventId === e.id && u.resourceId === c)).map(c=>({
                    resource: c,
                    event: e
                }))) : a.$processResourceIds = !0;
            else if (o != null && !e.meta.skipEnforcingSingleAssignment) {
                const c = a.getById(e.id);
                if (c && c !== e && !i) {
                    const h = l.storage.findItem("eventId", e.id);
                    if (h != null && h.size) {
                        const g = h.values().next().value;
                        g.resource = o,
                        e.reassignedFromReplace = !0
                    }
                } else
                    a.$processResourceIds = !0;
                a.usesSingleAssignment = !0
            }
            return e
        }
Screenshot 2024-02-20 at 9.47.14 AM.png
Screenshot 2024-02-20 at 9.47.14 AM.png (145.91 KiB) Viewed 136 times

Post by ghulam.ghous »

Hi Parl,

We could not reproduce this issue. To assist you with your question, please provide more details including a runnable test case (as described in our support guidelines viewtopic.php?f=35&t=772).

Are you able to reproduce this issue in our online examples? If yes can you please share the steps with us. To get the fastest possible support, provide a simple test case based on our standard examples.

Regards,
Ghous


Post by Animal »

When did this suddenly start happening?

Must be possible to trace it back to a code change.

Searching the whole sourxce tree for code that looks a little like this, it seems that it is this method. The unmangled code (I'd always use the unmangled code during development) looks like this:

Screenshot 2024-02-20 at 18.01.06.png
Screenshot 2024-02-20 at 18.01.06.png (196.72 KiB) Viewed 131 times

So assignmentStore seems to be not present. It should be. Something must have changed.


Post by Animal »

calendar.module.js would give you higher debuggability than calendar.module.min.js


Post by parl@nuviasmiles.com »

Whats weird is that on page refresh this store loads fine, it's only when running the store.add([]) function that this is failing. I'm running this in 2 environments, it works fine in one but not in the other so I can only reproduce in my production environment, which suggests it might be data? But it's doesn't tell me there's anything wrong nor can I see a problem with data.


Post by parl@nuviasmiles.com »

Turns out I'm filtering on Resources and sending in events that have no available resourceId, what is the best way to handle an unknown resourceId, is there a config for that?


Post by Animal »

I don’t understand what that means. Please share some code.


Post Reply