OWASP / OWASP/Nest

Bug : fix loading spinner logic for program edit, module edit

Open
#3,538 3 comments 0 reactions 0 assignees View on GitHub
bug enhancement
Dominant language
Python
Stars
451
Forks
702
Avg merge
22h 59m
Merged PRs (30d)
91

Description

**Describe the bug**

While editing a Program or Module in the Mentorship Portal, the loading spinner behavior is inconsistent and does not reliably reflect the actual loading state of the page.

In both Program Edit and Module Edit views, the spinner depends on indirect state combinations (access checks, session status, and form initialization), which can result in the spinner either staying visible longer than necessary or not accurately representing when the page is ready for interaction.

This affects the overall user experience, especially for admins who frequently navigate between edit views.

---

**To Reproduce**

*Program Edit:*
1. Sign in as a user with Program Admin permissions.
2. Navigate to **My Mentorship → Programs**.
3. Open any existing program.
4. Click on **Edit Program**.
5. Observe the loading spinner during page load.

*Module Edit:*
1. From the same program, open any module.
2. Click on **Edit Module**.
3. Observe the loading spinner while the edit page loads.

---

**Expected behavior**

- The loading spinner should be displayed only while required data (session, access checks, and program/module data) is being fetched.
- Once the edit form is ready for interaction, the spinner should be removed immediately.
- Spinner behavior should be consistent across both Program Edit and Module Edit pages.

---

**Are you going to work on fixing this?**

- [x] Yes
- [ ] No

---

**Additional context**

The issue appears in both:
- `my/mentorship/programs/[programKey]/edit`
- `my/mentorship/programs/[programKey]/modules/[moduleKey]/edit`

The spinner logic currently relies on indirect async state combinations rather than a single explicit page-level loading state, which leads to inconsistent behavior.

This improvement aligns with the Mentorship Portal improvement ideas discussed in #2701.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.