learningequality / studio

Content curation tools for Kolibri
https://studio.learningequality.org/
MIT License
117 stars 163 forks source link

Unstable - Create new exercise - ReferenceError: node details must be defined #4763

Open pcenov opened 1 month ago

pcenov commented 1 month ago

Observed behavior

This is a follow-up to https://github.com/learningequality/studio/pull/4761. Each time I create a new exercise I am seeing the following error in the console without any user facing consequences:

validation.js:42 Uncaught (in promise) ReferenceError: node details must be defined
    at isNodeComplete (validation.js:42:11)
    at updateNodeComplete (actions.js:8:20)
    at actions.js:92:13
    at dexie.min.mjs:1:15533
    at Me (dexie.min.mjs:1:10267)
    at Le (dexie.min.mjs:1:11024)
    at $e (dexie.min.mjs:1:10875)
    at dexie.min.mjs:1:15533

Expected behavior

It should be investigated whether this is problematic and the error should be fixed.

Steps to reproduce the issue

  1. Go to https://unstable.studio.learningequality.org/en/accounts/#/ and sign in
  2. Open a channel and create a new exercise
  3. Observe the error in the console

Additional information

2024-09-27_13-00-41

Usage Details

pcenov commented 1 month ago

@radinamatic

manzil-infinity180 commented 1 week ago

Image

here const node = context.rootGetters['contentNode/getContentNode'](nodeId); (/studio/contentcuration/contentcuration/frontend/channelEdit/vuex/assessmentItem/actions.js)

need nodeId as 4d5556cd94b046c3818ea092686ed496 but getting df153f3201ce49ed83363e26192b379f i tried with hardcoded with the nodeId 4d5556cd94b046c3818ea092686ed496 and see i am not getting any error

just one doubt? why two contendNode id ? so I can try to fix this issue I am currently reading docs soon will fix it?

Assign me !!

bjester commented 1 week ago

Hi @manzil-infinity180,

From your screenshot, the ID 4d5556cd94b046c3818ea092686ed496 appears to be the parent ID of the folder containing the exercise (assessment). In the case of the channel in your screenshot, that appears to be a root node of the channel. A Studio channel uses a recursive hierarchical structure where a content node of kind = topic can have children, who would have their parent / parent_id match the parent content node's ID.

The code you referenced retrieves from the vuex state a content node with ID of nodeId. In other words, the nodeId variable referenced by the code is actually the ID of the content node. In addition, content nodes have another field called node_id which is distinctly different and used for other purposes. I do not believe there's a mismatch with the IDs as that would lead to a more widespread problem, and does not align with the report that this happens "without any user facing consequences".