Skip to content

Use disposal-linked CancellationToken in dashboard dialogs#21

Merged
Theauxm merged 1 commit intomainfrom
fix/dialog-cancellation-tokens
Mar 31, 2026
Merged

Use disposal-linked CancellationToken in dashboard dialogs#21
Theauxm merged 1 commit intomainfrom
fix/dialog-cancellation-tokens

Conversation

@Theauxm
Copy link
Copy Markdown
Member

@Theauxm Theauxm commented Mar 27, 2026

Summary

  • RunTrainDialog and QueueTrainDialog used CancellationToken.None for CreateDbContextAsync() and SaveChanges() calls. Added IDisposable with a CancellationTokenSource so DB operations cancel if the dialog is disposed mid-operation.
  • Found during a CancellationToken audit across all Trax repos — every other component already uses DisposalToken from PollingComponentBase, but these two dialogs don't inherit from it.

Test plan

  • Zero build warnings
  • Verify dialog still creates metadata/work queue entries when submitted normally

RunTrainDialog and QueueTrainDialog used CancellationToken.None for database
operations. If the dialog is disposed mid-operation (user navigates away), the
DB calls now cancel instead of running to completion orphaned.
@Theauxm Theauxm merged commit 5c396ee into main Mar 31, 2026
1 check passed
@Theauxm Theauxm deleted the fix/dialog-cancellation-tokens branch March 31, 2026 20:44
@traxsharp
Copy link
Copy Markdown

traxsharp Bot commented Mar 31, 2026

This PR is included in version 1.10.1

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.

1 participant