Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 20, 2025

Problem

When changing a ticket's topic, the assignee widget would unexpectedly display a user even if the ticket was previously unassigned or assigned to a different user. This occurred because:

  1. The backend applies topic-specific auto-assignment rules when a ticket's topic is changed
  2. After changing the topic via API, refreshTicket() fetches the updated ticket data from the server
  3. The server response includes the auto-assigned user based on topic rules
  4. The UI reflects this server-assigned user, even though the user only intended to change the topic

This behavior was confusing because users expect the assignee to remain unchanged when they're only modifying the topic field.

Solution

Added logic to preserve the original assignee when changing a ticket's topic:

  • Introduced a changingTopic flag to track when a topic change operation is in progress
  • When handleTopicChanged() initiates a topic change, the flag is set and the current assignee is preserved
  • When refreshTicket() receives the updated ticket data, it restores the preserved assignee instead of accepting the server's auto-assigned user
  • The flag is cleared after the operation completes

This ensures that the assignee widget only changes when the user explicitly assigns/unassigns a ticket through the assignee control, not as a side effect of changing the topic.

Testing

Added two comprehensive tests to verify the fix:

  1. Unassigned ticket remains unassigned after topic change (even when server auto-assigns)
  2. Existing assignee is preserved when topic changes (even when server attempts to reassign)

All 919 tests pass with 82.11% coverage.

Fixes the issue where changing a ticket topic would unexpectedly modify the assignee.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /home/REDACTED/work/temba-components/temba-components/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome --disable-REDACTED-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=Translate,BackForwardCache --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --enable-blink-features=IdleDetection --export-tagged-pdf --headless --hide-scrollbars --mute-audio --font-render-hinting=medium --force-color-profile=srgb --hide-scrollbars --disable-web-security --force-device-scale-factor=1 --no-sandbox --disable-gpu --disable-font-subpixel-positioning --disable-lcd-text --force-prefers-reduced-motion --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-renderer-REDACTEDing --disable-gpu-sandbox --disable-software-rasterizer --disable-REDACTED-networking --disable-default-apps --disable-extensions --disable-sync --disable-translate --hide-crash-restore-bubble --metrics-recording-only --no-first-run --safebrowsing-disable-auto-update --use-mock-keychain --disable-ipc-flooding-protection --disable-component-update --disable-domain-reliability --remote-debugging-port=0 --user-data-dir=/tmp/puppeteer_dev_chrome_profile-3NheMt about:blank (dns block)
    • Triggering command: /home/REDACTED/work/temba-components/temba-components/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome --disable-REDACTED-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=Translate,BackForwardCache --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --enable-blink-features=IdleDetection --export-tagged-pdf --headless --hide-scrollbars --mute-audio --font-render-hinting=medium --force-color-profile=srgb --hide-scrollbars --disable-web-security --force-device-scale-factor=1 --no-sandbox --disable-gpu --disable-font-subpixel-positioning --disable-lcd-text --force-prefers-reduced-motion --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-renderer-REDACTEDing --disable-gpu-sandbox --disable-software-rasterizer --disable-REDACTED-networking --disable-default-apps --disable-extensions --disable-sync --disable-translate --hide-crash-restore-bubble --metrics-recording-only --no-first-run --safebrowsing-disable-auto-update --use-mock-keychain --disable-ipc-flooding-protection --disable-component-update --disable-domain-reliability --remote-debugging-port=0 --user-data-dir=/tmp/puppeteer_dev_chrome_profile-6MdYa8 about:blank (dns block)
    • Triggering command: /home/REDACTED/work/temba-components/temba-components/node_modules/puppeteer/.local-chromium/linux-982053/chrome-linux/chrome --disable-REDACTED-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=Translate,BackForwardCache --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-REDACTEDing --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --enable-blink-features=IdleDetection --export-tagged-pdf --headless --hide-scrollbars --mute-audio --font-render-hinting=medium --force-color-profile=srgb --hide-scrollbars --disable-web-security --force-device-scale-factor=1 --no-sandbox --disable-gpu --disable-font-subpixel-positioning --disable-lcd-text --force-prefers-reduced-motion --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-renderer-REDACTEDing --disable-gpu-sandbox --disable-software-rasterizer --disable-REDACTED-networking --disable-default-apps --disable-extensions --disable-sync --disable-translate --hide-crash-restore-bubble --metrics-recording-only --no-first-run --safebrowsing-disable-auto-update --use-mock-keychain --disable-ipc-flooding-protection --disable-component-update --disable-domain-reliability --remote-debugging-port=0 --user-data-dir=/tmp/puppeteer_dev_chrome_profile-K8CKDz about:blank (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Bug in ticket assignee widget</issue_title>
<issue_description>1. Go to unassigned ticket
2. Change topic
3. Assignee widget switches to a user</issue_description>

Comments on the Issue (you are @copilot in this section)

Fixes #692


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Preserve the original assignee when changing a ticket's topic to prevent server-side auto-assignment from unexpectedly changing the assignee in the UI. This ensures that when users change only the topic, the assignee remains as they set it (or remains unassigned) rather than being auto-populated based on server-side topic assignment rules.

Co-authored-by: ericnewcomer <[email protected]>
Copilot AI changed the title [WIP] Fix bug in ticket assignee widget functionality Fix ticket assignee widget incorrectly showing user after topic change Oct 20, 2025
Copilot AI requested a review from ericnewcomer October 20, 2025 19:03
Copilot finished work on behalf of ericnewcomer October 20, 2025 19:03
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.

Bug in ticket assignee widget

2 participants