Skip to content

Fix async state management in ReassignModal#15

Merged
techbuzzz merged 2 commits into
developfrom
copilot/sub-pr-11-yet-again
Jan 27, 2026
Merged

Fix async state management in ReassignModal#15
techbuzzz merged 2 commits into
developfrom
copilot/sub-pr-11-yet-again

Conversation

Copilot AI commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

The ReassignModal component was managing isSubmitting state locally and resetting it immediately after emitting the reassign event, causing the submit button to re-enable before the parent's async API request completed.

Changes:

  • ReassignModal.vue: Accept isSubmitting as prop instead of managing it locally; removed async wrapper and state reset from handleSubmit
  • ProjectDetail.vue: Added isReassigningTask ref; wrapped handleReassignTask with try-finally to control state lifecycle; passed state as prop to modal

Before:

// Modal manages its own state
const handleSubmit = async () => {
  isSubmitting.value = true
  try {
    emit('reassign', data)  // Fire-and-forget
  } finally {
    isSubmitting.value = false  // Resets immediately
  }
}

After:

// Parent manages state across async boundary
const handleReassignTask = async (data) => {
  isReassigningTask.value = true
  try {
    await fetch(...)  // Actual async operation
  } finally {
    isReassigningTask.value = false  // Resets after completion
  }
}

Button now stays disabled until API request completes or fails.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Move isSubmitting state to parent (ProjectDetail)
- Pass isSubmitting as prop to ReassignModal
- Properly manage async state throughout reassignment lifecycle
- Button stays disabled until API request completes

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback from review on release v0.3.5 Fix async state management in ReassignModal Jan 27, 2026
Copilot AI requested a review from techbuzzz January 27, 2026 16:50
@techbuzzz techbuzzz marked this pull request as ready for review January 27, 2026 17:45
Copilot AI review requested due to automatic review settings January 27, 2026 17:45
@techbuzzz techbuzzz merged commit 82541f4 into develop Jan 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a race condition in the ReassignModal component where the submit button would re-enable prematurely before the parent's async API request completed. The solution moves the loading state management from the child modal to the parent component, ensuring the button stays disabled until the API operation finishes.

Changes:

  • Moved isSubmitting state management from ReassignModal to parent ProjectDetail component
  • Added try-finally block in parent's handleReassignTask to properly control state lifecycle
  • Passed loading state as prop to modal for controlled button disabling

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
web/src/components/ReassignModal.vue Converted to controlled component by accepting isSubmitting prop; removed local async state management
web/src/views/ProjectDetail.vue Added isReassigningTask ref with proper lifecycle management in try-finally block; passes state to modal
web/package-lock.json Automated npm lock file updates (removal of peer: true flags from several dependencies)
Files not reviewed (1)
  • web/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

taskId: props.task.id,
agentId: selectedAgentId.value
})
selectedAgentId.value = ''

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

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

The local form state is being reset immediately after emitting the reassign event, before the parent's async operation completes. This causes the selectedAgentId to clear while the modal is still visible (if an error occurs and the modal stays open).

The watch on props.show already resets selectedAgentId when the modal opens, so this line should be removed. Let the parent control when the modal closes, and the watch will naturally reset the form when it reopens.

Suggested change
selectedAgentId.value = ''

Copilot uses AI. Check for mistakes.
techbuzzz added a commit that referenced this pull request Jan 28, 2026
* chore(gitignore): 🗃️ add `postgres_data/` to .gitignore

* Ensures that the `postgres_data/` directory and its contents are excluded from version control.
* Prevents accidental commits of local PostgreSQL data files.

* feat(tasks): add task reassignment functionality with new API endpoint and UI modal

* feat(mcp): enhance MCPHandler to broadcast agent updates via WebSocket
feat(TaskCard): display task ID in the TaskCard component

* fix(TaskCard): adjust layout to properly display task ID and due date

* fix(TaskCard): remove due date display from task card

* Release v0.3.5 – Daily Standup Management & Production Migrations (#10)

* feat: add daily standup and agent heartbeat models, migrations, and Vue components

- Implemented DailyStandup and AgentHeartbeat models in Go with necessary fields.
- Created SQL migrations for daily_standups and agent_heartbeats tables with indexes.
- Developed StandupModal component for submitting and editing daily standups with form validation.
- Added standupStore for managing standup data, including fetching, creating, updating, and deleting standups.
- Created Standups view to display a list of daily standups with filtering options and modal integration.
- Enhanced UI with loading states, error handling, and markdown rendering for standup details.

* fix(go.mod): remove 'indirect' comments from dependency requirements

* feat(migrations): implement automatic migration system with tracking and bootstrap scripts

* feat: add release notes for v0.3.5 including daily standup management and migration system

* Initial plan

* Initial plan

* Initial plan

* Add application verification report for v0.3.5

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Update internal/handlers/standups.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update scripts/bootstrap-migrations.ps1

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Initial plan (#20)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Refactor task reassignment to use shared API client (#18)

* Initial plan

* Refactor task reassignment to use shared API client

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Fix migration race condition in concurrent container startups (#19)

* Initial plan

* Make migration loop safe for concurrent startups using INSERT ON CONFLICT

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Add concurrency safety test and documentation for migrations

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Address code review feedback: improve error handling and add sql import

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Filter migrations to only run numbered files, skip bootstrap helpers (#17)

* Initial plan

* feat(migrations): filter to only run numbered migrations, skip helper scripts

Add regex pattern to only execute numbered migrations (e.g., 001_init.sql, 002_sample_data.sql)
and skip helper scripts like bootstrap_existing_db.sql. This prevents the bootstrap script
from being run automatically during the migration process, maintaining the intended
"run once for existing DBs" bootstrap flow.

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* refactor: move regex compilation outside loop for efficiency

Move migration pattern compilation to the beginning of runMigrations function
to avoid repeated compilation overhead on each function call.

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Add aria-label to icon-only buttons in Standups view (#16)

* Initial plan

* feat(a11y): add aria-label to edit/delete buttons in Standups view

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Fix async state management in ReassignModal (#15)

* Initial plan

* Fix isSubmitting state management in ReassignModal

- Move isSubmitting state to parent (ProjectDetail)
- Pass isSubmitting as prop to ReassignModal
- Properly manage async state throughout reassignment lifecycle
- Button stays disabled until API request completes

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* fix(standups): return 404 on non-existent update and broadcast changes (#14)

* Initial plan

* fix(standups): improve UpdateStandup to check rows affected and return updated object

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* fix(standups): handle error from RowsAffected in UpdateStandup

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Fix metadata loss in AgentCard legacy capability unmarshaling (#13)

* Initial plan

* fix: preserve legacy capabilities in metadata after struct assignment

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* style: remove extra blank line for consistency

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Address PR #11 review comments: preserve metadata, add 404 checks, improve concurrency safety and accessibility (#12)

* Initial plan

* fix: preserve legacy capabilities in metadata and add 404 checks for standup updates/deletes

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* fix(ui): improve accessibility, state management, and date handling in frontend components

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* fix(migrations): skip bootstrap files and add advisory lock for concurrency safety

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* fix(api): use API service for task reassignment and sanitize database URL in logs

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* refactor: improve code quality based on review feedback

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>
Co-authored-by: Victor Buzin <buzin.victor@gmail.com>

* Update web/src/services/api.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update internal/handlers/standups.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Initial plan (#21)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Initial plan (#22)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Initial plan (#23)

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

* Restore transactional migration execution with automatic rollback (#24)

* Initial plan

* Restore transactional migration execution with rollback safety

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Improve transaction handling with defer cleanup and race condition handling

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Extract migration application into separate function for proper defer scoping

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Add missing database/sql import (#25)

* Initial plan

* Add missing database/sql import to fix compile error

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Make database migrations transactional (#26)

* Initial plan

* refactor: make migrations transactional and safe

- Execute migration DDL within a transaction
- Record migration in schema_migrations only after DDL succeeds
- Commit both DDL and tracking record atomically
- Proper rollback on any failure
- Now matches "Automatic, transactional, safe" claim in verification report

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* refactor: simplify migration transaction logic per code review

- Remove complex ON CONFLICT detection with RETURNING
- Use simple ON CONFLICT DO NOTHING for defense-in-depth
- Remove unused database/sql import
- Improve comments explaining PostgreSQL transactional DDL support
- Simplify error handling paths

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>
Co-authored-by: Victor Buzin <buzin.victor@gmail.com>

* Sort migration files to ensure deterministic execution order (#27)

* Initial plan

* Sort migration files to ensure deterministic execution order

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Fix readonly prop mutation in ReassignModal (#28)

* Initial plan

* Fix isSubmitting prop mutation in ReassignModal

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Fix isReassigningTask state not resetting after reassignment (#29)

* Initial plan

* Fix isReassigningTask state management by adding finally block

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>
Co-authored-by: Victor Buzin <buzin.victor@gmail.com>

* Fix migration race: execute DDL before recording completion (#30)

* Initial plan

* Fix migration safety: execute DDL before recording success

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Remove server binary and add to gitignore

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Address code review: check rollback errors and simplify ON CONFLICT

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>
Co-authored-by: Victor Buzin <buzin.victor@gmail.com>

* Enhance sample data migration: add idempotent comments and ensure conflict handling for inserts

* Refactor standup model and handlers: rename references to reference_links for consistency

* Add MCP Setup Documentation and Verification Files

- Created MCP_SETUP_QUICK_REFERENCE.md for quick setup and command usage.
- Added MCP_SETUP_REVIEW.md detailing component verification and functionality.
- Introduced MCP_SETUP_VERIFICATION_SUMMARY.md summarizing the verification process and results.

* Add comprehensive documentation for Visual Studio 2026 MCP integration

- Created VS2026_DOCUMENTATION_INDEX.md for quick navigation and role-based reading guide.
- Added VS2026_FEATURE_SUMMARY.md detailing key features, deployment options, and generated files.
- Introduced VS2026_IMPLEMENTATION_GUIDE.md with step-by-step setup instructions and UI integration examples.
- Developed VS2026_MCP_SETUP.md outlining configuration files, usage examples, and troubleshooting tips.
- Enhanced composable with new functions and improved error handling.

* Refactor MCP setup: enhance error handling, add support for Blob downloads, and update event handlers for better user feedback

* Refactor code structure for improved readability and maintainability

* [WIP] WIP Address feedback on Release v0.3.5 changes (#31)

* Initial plan

* Fix mcpApiUrl to use hostname instead of host to avoid double port issue

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Remove unused isRef import from useMcpSetup composable (#32)

* Initial plan

* Remove unused isRef import from useMcpSetup.js

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Update cmd/server/main.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update internal/handlers/standups.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Fix advisory lock session scope in database migrations (#33)

* Initial plan

* Fix advisory lock to use dedicated connection for session scope

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Remove UTF-8 BOM from migration file (#34)

* Initial plan

* Remove UTF-8 BOM from migrations/003_daily_standups.sql

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Fix backward compatibility: restore `references` JSON field for standup models (#35)

* Initial plan

* Fix backward compatibility: change JSON tag from reference_links to references

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Harden formatDate validation to prevent RangeError on invalid inputs (#36)

* Initial plan

* Add validation for formatDate to prevent RangeError with invalid dates

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Improve date validation: add rollover check and error handling

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Refactor formatDate: extract fallback parsing to eliminate duplication

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Remove shadowing imports in ProjectDetail.vue (#37)

* Initial plan

* Remove unused downloadFile and downloadAllMcpFiles imports

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Fix .mcp download to use VS2026 config instead of VSCode config (#38)

* Initial plan

* Fix .mcp download to use VS2026 config instead of VSCode config

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

* Align VS2026 MCP documentation with minimal config implementation (#39)

* Initial plan

* Update VS2026 docs to match actual minimal config implementation

Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: techbuzzz <6938100+techbuzzz@users.noreply.github.com>
@techbuzzz techbuzzz deleted the copilot/sub-pr-11-yet-again branch January 28, 2026 13:44
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