-
Notifications
You must be signed in to change notification settings - Fork 132
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
Some fixes for Standalone Function portal #2004
Conversation
…wn after creating subscription ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous\n Name and Subscription field in Create app resized\n Creating subscription with empty display name is not allowed\n Creating app with empty name is not allowed
@exc3eed, |
@@ -404,6 +409,9 @@ export class SideNavComponent implements AfterViewInit { | |||
// so we need to make sure we're always overwriting them. But if we simply | |||
// set the value to the same value twice, no change notification will happen. | |||
private _updateSubDisplayText(displayText: string) { | |||
if (this._subscriptionOptionsUpdated) { // BUGBUG this is an workaround for https://github.com/Azure/azure-functions-ux/issues/2003 |
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.
_subscriptionOptionsUpdated [](start = 17, length = 27)
This flag seems redundant to _subscriptionOptionsInitialized and it looks like you'd get the same behavior if you used that flag instead. #WontFix
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.
_subscriptionOptionsUpdated will be true when subscriptionOptions Initialized more than or equal to two times. but _subscriptionOptionsInitialized will be true after one initialization So the behavior is not same here
In reply to: 149693692 [](ancestors = 149693692)
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.
I just realized that we're subscribing to startupinfo twice. I'm not positive, but it's possible that the update issue you're seeing (#2003) has something to do with this. Instead, of subscribing to getStartupInfo again, just pass in the info object from the caller. That may resolve the ExpressionChangedAfterItHasBeenCheckedError you're seeing. #Resolved Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
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.
🕐
Passing the info is a good idea but this is not resolving ExpressionChangedAfterItHasBeenCheckedError issue. In reply to: 342844825 [](ancestors = 342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
Why won't it? Aren't you updating the list of subscriptions? Or am I misunderstanding the scenario where this is triggered? Can you just try it to see? I'd rather fix the root of the problem then create all these new properties for state management, especially when it's only used for Function runtime scenario's. In reply to: 343007162 [](ancestors = 343007162,342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
…wn after creating subscription ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous\n Name and Subscription field in Create app resized\n Creating subscription with empty display name is not allowed\n Creating app with empty name is not allowed
regardless of it resolving the ExpressionChangedAfterItHasBeenCheckedError or not, you should not have an untracked subscription that doesn't get cleaned up before another is set up. also if this PR is introducing ExpressionChangedAfterItHasBeenCheckedError, then it needs to be fixed in this PR In reply to: 342844825 [](ancestors = 342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
@@ -59,6 +61,7 @@ export class SideNavComponent implements AfterViewInit { | |||
public searchTerm = ''; | |||
public hasValue = false; | |||
public tryFunctionApp: FunctionApp; | |||
public headerOnTopOfSideNav = this._scenarioService.checkScenario(ScenarioIds.headerOnTopOfSideNav).status === 'enabled'; |
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.
move initialization to a constructor #Resolved
let descriptor: SiteDescriptor; | ||
const savedSubs = <StoredSubscriptions>this.localStorageService.getItem(LocalStorageKeys.savedSubsKey); | ||
const savedSelectedSubscriptionIds = savedSubs ? savedSubs.subscriptions : []; | ||
let descriptor: SiteDescriptor; |
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.
set type to SiteDescriptor | null
#Resolved
I filed a bug for it reproduction instruction is here https://github.com/Azure/azure-functions-ux/issues/2003 In reply to: 343007586 [](ancestors = 343007586,343007162,342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
if (this._subscriptionOptionsInitialized) { | ||
this._subscriptionOptionsUpdated = true; | ||
} | ||
this._subscriptionOptionsInitialized = true; |
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.
remove #Resolved
@@ -68,6 +71,8 @@ export class SideNavComponent implements AfterViewInit { | |||
|
|||
private _initialized = false; | |||
|
|||
private _subscriptionOptionsInitialized = false; | |||
private _subscriptionOptionsUpdated = false; |
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.
remove #Resolved
@@ -404,55 +407,59 @@ export class SideNavComponent implements AfterViewInit { | |||
// so we need to make sure we're always overwriting them. But if we simply | |||
// set the value to the same value twice, no change notification will happen. | |||
private _updateSubDisplayText(displayText: string) { | |||
if (this._subscriptionOptionsUpdated) { // BUGBUG this is an workaround for https://github.com/Azure/azure-functions-ux/issues/2003 | |||
return; | |||
} |
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.
remove #Resolved
What do you mean by untracked subscription? One way to fix the issue is using using ChangeDetectionStrategy.OnPush This seems right to me. But this is causing #1987 In reply to: 343008517 [](ancestors = 343008517,342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
by untracked subscription I meant calling .subscribe() multiple times on a stream without properly disposing of the previous subscribe. Subscribe is not just a call back to 1 event, it'll run on every event from that source. If you setup a subscription that's not tracked to unsubscribe, then you are either creating a subscription that's expected to live for the life time of the app (e.g: see the getStartupInfo() subscription in the constructor. That's an untracked subscription. but that's okay because it's expected to have the life time of the app._ the other place where you may have an untracked subscription is if it's an http observable since though complete immediately. anything other than that, you need to save your subscription and figure out when to unsubscribe In reply to: 343010787 [](ancestors = 343010787,343008517,342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
I am lost. Can you suggest me what will be the right fix here? In reply to: 343013546 [](ancestors = 343013546,343010787,343008517,342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
It sounds like the issue is because displayText is updated internally from MultiDropdown list and also from onSubscriptionsSelect() method because subscriptionOption is updated. Maybe we shouldn't update displayText from two place In reply to: 343015671 [](ancestors = 343015671,343013546,343010787,343008517,342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
Ok just found a simplified workaround for it In reply to: 343016367 [](ancestors = 343016367,343015671,343013546,343010787,343008517,342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
…wn after creating subscription ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous\n Name and Subscription field in Create app resized\n Creating subscription with empty display name is not allowed\n Creating app with empty name is not allowed
|
||
.header-on-top-of-sidenav { | ||
position: absolute; | ||
} |
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.
have you tested this in ibiza? #WontFix
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.
oh never mind, it's not an ibiza scenario #Resolved
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 not applicable for ibiza. it will be only applied for standalone function portal.
In reply to: 150031420 [](ancestors = 150031420)
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.
Check one last time with @ehamai as well
I dunno, it seems pretty hacky to have 2 setTimeouts. Someone is definitely going to clean this up later and you'll be broken again. At the very least can you settle for one? BTW I still don't think that this addresses whatever the root cause of the problem is but I'm willing to compromise if you can just use one settimeout. In reply to: 343017103 [](ancestors = 343017103,343016367,343015671,343013546,343010787,343008517,342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
I have seen setTimeout is multiple places. It sounds like it is a workaround for component issue in this case MultidropdownList is also trying to update the disPlaytext. In reply to: 343248046 [](ancestors = 343248046,343017103,343016367,343015671,343013546,343010787,343008517,342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
…wn after creating subscription ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous\n Name and Subscription field in Create app resized\n Creating subscription with empty display name is not allowed\n Creating app with empty name is not allowed
Yes and it's usually a hack to get around this problem. I'm saying that 2 setTimeouts really seems bad. Can you at least settle for one? In reply to: 343288222 [](ancestors = 343288222,343248046,343017103,343016367,343015671,343013546,343010787,343008517,342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
Okay looking at your change, it looks like you used one setTimeout whereas your comment above had 2 which is why I was concerned. In reply to: 343288687 [](ancestors = 343288687,343288222,343248046,343017103,343016367,343015671,343013546,343010787,343008517,342844825) Refers to: AzureFunctions.AngularClient/src/app/side-nav/side-nav.component.ts:428 in a153f32. [](commit_id = a153f32, deletion_comment = False) |
4.Creating app with empty name is not allowed.
5. Header is now on top of sidenav and dashboard