Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DUI3-173: adds send and receive cancellation on document switch #3499

Conversation

clairekuang
Copy link
Member

@clairekuang clairekuang commented Jun 11, 2024

Description & motivation

Prevents document activation (creation/switch) during ongoing send/receive operation.

@@ -83,7 +92,7 @@ private void OnSendOperationProgress(string modelCardId, string status, double?
// POC: JEDD: We should not update the UI until a OperationCancelledException is caught, we don't want to show the UI as cancelled
// until the actual operation is cancelled (thrown exception).
// I think there's room for us to introduce a cancellation pattern for bindings to do this and avoid this _cancellationManager
public void CancelSend(string modelCardId) => _cancellationManager.CancelOperation(modelCardId);
Copy link
Member

Choose a reason for hiding this comment

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

Was it really that much wrong all this time? 🤦‍♂️

public async Task Receive(string modelCardId)
{
using var unitOfWork = _unitOfWorkFactory.Resolve<ReceiveOperation>();
try
{
Application.DocumentManager.DocumentActivated += (sender, args) =>
Copy link
Member

Choose a reason for hiding this comment

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

Not sure way of subscribing it, let's hold it till tomorrow AM and sync?

@clairekuang clairekuang merged commit b58c348 into dui3/alpha Jun 20, 2024
33 checks passed
@clairekuang clairekuang deleted the DUI3-173-RVT-ACAD-Fix-new-document-creation-when-send-receive-is-in-progress branch June 20, 2024 12:11
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