openedx / openedx/frontend-app-discussions

Error during creating a post from new discussion MFE sidebar

Open
#751 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
7
Forks
113
PR merge metrics
No merged PRs in 30d

Description

Image

From logs, I was able to find that a forEach.. function is causing the issue in discussions/posts/data/hooks.js, where post.pinned is causing issue as initially it is getting an undefined post.
https://github.com/openedx/frontend-app-discussions/blob/58aa512f47957063f300095c516cbf4b031c7d6d/src/discussions/posts/data/hooks.js#L14

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/discussions/posts/data/hooks.js line 14 and reproduce creating a post from the new discussion MFE sidebar. Trace the forEach call and the initial undefined post; done means the post creation flow no longer errors when that value is encountered.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.