-
Notifications
You must be signed in to change notification settings - Fork 177
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
feat(Navisworks): Retry Sending already converted objects. Implements #2668 #2670
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adds a new button to the Navisworks ribbon that allows users to retry sending the last complete conversion to Speckle. The new button is added in Ribbon.xaml and Ribbon.xaml.cs, and its functionality is implemented in RibbonHandler.cs. The code also includes some minor changes such as renaming a command shortcut and adding comments for clarity.
This commit adds caching for the last conversion and commit objects to improve performance when retrying a failed send operation. The cached objects are used in the new `RetryLastConversionSend` method, which allows users to retry sending data without having to re-convert everything from scratch.
This change clears the cachedCommit and cachedConversion variables after creating a commit in ConnectorNavisworksBindings.Send.cs. This ensures that the latest data is always used and avoids any potential issues with stale data.
- Added new using statements for Models and Utilities. - Added a new method RetryLastConversionSend() to ConnectorBindingsNavisworks class. - Modified SendConvertedObjectsToSpeckle() and CreateCommit() methods in ConnectorBindingsNavisworks class to use the cached conversion objects. - Added a new field _cachedState to store the state of the stream before sending data to Speckle. - Modified ExecuteCommand() method in RibbonHandler class to call RetryLastConversionSend() method from Bindings object instead of directly calling it. - Created a new field Bindings in SpeckleNavisworksCommandPlugin class.
- Remove unused variables - Clear cached objects when necessary
…onnectorBindingsNavisworks.Send.cs This commit adds a new boolean flag called isRetrying to the ConnectorBindingsNavisworks class. It also handles this flag in the Send method of the same class, where it throws an exception if isRetrying is false and debug mode is enabled.
This commit adds a retry button to the Ribbon in ConnectorNavisworks. It also includes two new resources, "retry16.ico" and "retry32.ico", which are used as icons for the new button. Additionally, some code was commented out that threw an exception when not in debug mode.
AlanRynne
approved these changes
Jun 15, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good! After your demo yesterday I'm super keen on having this... EVERYWHERE (included as a DUI feature).
Anyhow, in it goes!
Kudos for the detailed message history 🚀 |
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a highly speculative but functional adaptation. If long sends become possible from the server, this may be moot. I am open to rejections on this.
This PR adds a new Ribbon button that resends a commit that has failed to send to completion post successful Conversion. Motivation is centred around long sends being cancelled, which loses potentially long conversions—wasting users' time.
The converted and draft Commit objects are cached on completing the conversion. A successful Transport and Commit nullify these caches.
The Retry Send button is enabled if the Main thread becomes idle and the cached items still exist, indicating either Transport or the Commit Send failed.
When Retry Send completes, it nullifies the caches, as does changing the document or starting a new Send.
It is a little hacky and isn't completely tied into the DUI just yet - the failed send Sets the CancellationToken as cancelled - can research if this can be uncancelled (A newly created
ProgressViewModel
is divorced from DUI)