Disable Network Traffice When Notification Center Disabled#13286
Disable Network Traffice When Notification Center Disabled#13286QilongTang merged 2 commits intomasterfrom
Conversation
| [ClassInterface(ClassInterfaceType.AutoDual)] | ||
| [ComVisible(true)] | ||
| public class scriptObject | ||
| public class ScriptObject |
There was a problem hiding this comment.
This is a name vialation, I think in C# public class are all capitalized
RobertGlobant20
left a comment
There was a problem hiding this comment.
LGTM with one comment
| // This ensures no network traffic when Notification center feature is turned off | ||
| if (dynamoViewModel.PreferenceSettings.EnableNotificationCenter) | ||
| { | ||
| RequestNotifications(); |
There was a problem hiding this comment.
As far as I know the RequestNotifications(); only populates the number of notifications in the bell icon but this won't prevent that the webapp consume the REST API (not sure if that is the expected behavior).
There was a problem hiding this comment.
@RobertGlobant20 This will prevent Dynamo making the REST API calls, do you mean the WebApp will still do it?
There was a problem hiding this comment.
what about simply not loading the extension?
There was a problem hiding this comment.
@QilongTang if the objective is to prevent just Dynamo to make REST API calls then is OK but if you want also to prevent those calls in the WebApp then is a different story.
There was a problem hiding this comment.
@RobertGlobant20 @mjkkirschner My understanding is that the latest version of Notification Center is using process.env to control the endpoint and REST API calls will be made depending on if the endpoint address exist or not. When consumed by Dynamo, the end point is empty. I believe @filipeotero made such change so when used in Dynamo, the WebApp itself should not pull anything but rely on info passed by Dynamo.
There was a problem hiding this comment.
@filipeotero Please let me know if my understanding is correct. If not, then happy to follow up
There was a problem hiding this comment.
@QilongTang You are correct. The webApp itself will not request notifications if process.env.NOTIFICATION_URL is not set and it is empty when the app is consumed by dynamo. Dynamo calls the endpoint and passes notifications to window.setNotifications.
There was a problem hiding this comment.
That's correct. In Dynamo, the notification center is waiting to push the notifications. Executing the notification center in development mode will grab the notifications by itself.
Please Note:
DynamoRevitrepo will need to be cherry-picked into all the DynamoRevit Release branches that Dynamo supports. Contributors will be responsible for cherry-picking their reviewed commits to the other branches after aLGTMlabel is added to the PR.Purpose
Disable Network Traffice When Notification Center Disabled

Declarations
Check these if you believe they are true
*.resxfilesRelease Notes
Disable Network Traffice When Notification Center Disabled
Reviewers
@DynamoDS/dynamo
FYIs
(FILL ME IN, Optional) Names of anyone else you wish to be notified of