Skip to content

Conversation

@DiyaWadhwani
Copy link
Contributor

@DiyaWadhwani DiyaWadhwani commented Sep 16, 2025

Description

This PR fixes the below 2 issues:

  1. When the WBS tasks page is open in 2 browsers. Adding a task in Browser A does not reflect immediately in Browser B until refresh. Adding a task in Browser B without refresh displays an alert "Database changed since your page loaded , click OK to get the newest data!". Clicking OK refreshes the page and then displays task added from both browsers.
  2. Adding a new task on first load of browser displays WBS # 1 even if tasks already exist.

Related PRS (if any):

None

Main changes explained:

  • AddTaskModal.jsx
    -- Commented out the DB update alert.
    -- Compute tasksList from props.tasks (no direct Redux bind) and derive defaultCategory safely.
    -- Reworked getNewNum() to use tasksList and current context (taskId, level, taskNum).
    -- Recalculate WBS on modal open and when tasksList.length, taskId, level, or taskNum change.
    -- Hardened null checks for allProjects.projects and tasksList to avoid .find on undefined.

  • ControllerRow.jsx
    -- Pass the current tasks down to so numbering logic always has context.

  • Task.jsx
    -- Forward tasks to and children; avoid directly binding tasks via mapStateToProps here.

  • actions/task.js
    -- Keep returning the full created task object from addNewTask (callers can use _id or other fields if needed).

How to test:

  1. Check into current branch
  2. Do npm install and ... to run this PR locally
  3. Clear site data/cache
  4. Login as user who has access to create tasks
  5. Duplicate this into another window as shown in video and create tasks without refreshing.
  6. Verify that alert is no longer visible
  7. Verify that adding a new task on first time load of the page shows wbs number +1 of how many tasks are present

Screenshots or videos of changes:

TaskFix_DBAlert.mp4

Note:

Please refer to the video of before and after changes!

@netlify
Copy link

netlify bot commented Sep 16, 2025

Deploy Preview for highestgoodnetwork-dev ready!

Name Link
🔨 Latest commit 1e8c750
🔍 Latest deploy log https://app.netlify.com/projects/highestgoodnetwork-dev/deploys/68c900bdf145e30008300d1e
😎 Deploy Preview https://deploy-preview-4083--highestgoodnetwork-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@one-community one-community merged commit c85117d into development Sep 16, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants