Skip to content

Conversation

@Vasist10
Copy link
Contributor

@Vasist10 Vasist10 commented Dec 26, 2025

Description

Added cycle detection to prevent task dependency loops (e.g., Task A → Task B → Task A).

Checklist

  • Ran npx prettier --write . (for formatting)
  • Ran gofmt -w . (for Go backend)
  • Ran npm test (for JS/TS testing)
  • Added unit tests, if applicable
  • Verified all tests pass
  • Updated documentation, if needed

Additional Notes

Screenshot 2025-12-28 150247

@github-actions
Copy link

Thank you for opening this PR!

Before a maintainer takes a look, it would be really helpful if you could walk through your changes using GitHub's review tools.

Please take a moment to:

  • Check the "Files changed" tab
  • Leave comments on any lines for functions, comments, etc. that are important, non-obvious, or may need attention
  • Clarify decisions you made or areas you might be unsure about and/or any future updates being considered.
  • Finally, submit all the comments!

More information on how to conduct a self review:
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-proposed-changes-in-a-pull-request

This helps make the review process smoother and gives us a clearer understanding of your thought process.

Once you've added your self-review, we'll continue from our side. Thank you!

@Vasist10
Copy link
Contributor Author

Vasist10 commented Dec 28, 2025

the latest 3 commits fix:

  • Improve the toast message to make to more clearer from a generic message
  • Fix an issue where a task involved in a circular dependency still appeared in the UI even after the backend rejected the update, until a manual sync was triggered.
    ex:
    In this below image the task 'panic' forms a circular dependency with task 'panib' and task 'pania'.....but still even after the backend rejects the dependency the task 'panic' is appearing in the frontend(until sync was applied).
Screenshot 2025-12-28 120833

this ui buggy behavior is fixed now

@Vasist10
Copy link
Contributor Author

@its-me-abhishek i have added the self review and fixed the ui buggy behavior.

// Show specific message for Edit Task failures
let errorMessage = `Failed to ${data.job || 'perform action'}`;
if (data.job === 'Edit Task') {
errorMessage =
Copy link
Collaborator

@its-me-abhishek its-me-abhishek Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might not be the case everytime for this Jobs failure, and can be misleading.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can revert this for now, and leave this as it is. will add a separate toast flow later

// This ensures the Tasks component sees the updated data
if (data.job === 'Edit Task') {
// For Edit Task, we need to trigger a sync to update the UI
window.dispatchEvent(new CustomEvent('syncTasks'));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this really required? Can we skip this?

task.annotations || []
);
} catch (error) {
console.error('Failed to update dependencies:', error);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just add a new toast here instead of changing it in HomePage

});

console.log('Task edited successfully!');
// Don't show success message here - wait for WebSocket confirmation
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove this and other such copilot based comments, they add to the bloat

return () => clearInterval(interval);
}, []);

// Listen for sync events from WebSocket handler
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similarly, please remove trivial comments

syncTasksWithTwAndDb();
};

window.addEventListener('syncTasks', handleSyncTasks);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this UseEffect and event listener architecture, and make use of other Sync based Effects available

color[node] = 0
}

for _, deps := range graph {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This n^2 loop needs to be optimized

Copy link
Collaborator

@its-me-abhishek its-me-abhishek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please look into the above comments

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.

Circular dependency in task dependencies

2 participants