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

[Service Bus] Move scheduledMessageCount to TopicRuntimeProps from SubscriptionRuntimeProps #10250

Merged
merged 3 commits into from
Jul 28, 2020

Conversation

HarshaNalluru
Copy link
Member

Issue #10241

@HarshaNalluru
Copy link
Member Author

/azp run js - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines 109 to 113
type MakeTOptional<M, T extends keyof M> = Partial<Pick<M, T>> & Omit<M, T>;
const messageCountDetails: MakeTOptional<
MessageCountDetails,
"scheduledMessageCount"
> = getMessageCountDetails(rawSubscription[Constants.COUNT_DETAILS]);
Copy link
Contributor

Choose a reason for hiding this comment

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

but why...

I tried the below and it builds just fine

  const messageCountDetails = getMessageCountDetails(rawSubscription[Constants.COUNT_DETAILS]);
  delete messageCountDetails.scheduledMessageCount;

Copy link
Member Author

Choose a reason for hiding this comment

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

Wait what... How could you?
image

Copy link
Member Author

@HarshaNalluru HarshaNalluru Jul 24, 2020

Choose a reason for hiding this comment

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

Interesting, the build succeeded for me but the squiggly lines are present, say that "The operand of a 'delete' operator must be optional."

Copy link
Contributor

Choose a reason for hiding this comment

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

What version of TypeScript is your vscode using? (Should show in the lower right-hand side) Maybe it's a newer one than what the project compiles with.

Copy link
Member Author

@HarshaNalluru HarshaNalluru Jul 24, 2020

Choose a reason for hiding this comment

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

So, TS had a change microsoft/TypeScript#37921 to add this check(The operand of a 'delete' operator must be optional.), they reverted it in microsoft/TypeScript#38154 in [email protected] since it broke VSCode(microsoft/vscode#96022).
Planned this check for a later release [email protected] and hence reverted the revert in microsoft/TypeScript#38173 for [email protected].

Technically, we should not be able to delete the non-optional properties moving forward.

Copy link
Member Author

Choose a reason for hiding this comment

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

What version of TypeScript is your vscode using? (Should show in the lower right-hand side) Maybe it's a newer one than what the project compiles with.

My VS Code is on typescript@next - Currently, I'm on this version - https://www.npmjs.com/package/typescript/v/4.0.0-dev.20200717

Copy link
Contributor

Choose a reason for hiding this comment

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

I am on 3.9.6

Even if we want to future proof ourself, I'd much rather get rid of getMessageCountDetails() and inline that code rather than use the above in order to help readability of code.

Copy link
Member Author

Choose a reason for hiding this comment

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

8cb0478, fine?

@HarshaNalluru HarshaNalluru changed the title [Service Bus] Move Move scheduledMessageCount to TopicRuntimeProps from SubscriptionRuntimeProps [Service Bus] Move scheduledMessageCount to TopicRuntimeProps from SubscriptionRuntimeProps Jul 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants