-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[App Config] updateSyncToken method #14507
Merged
Merged
Changes from 5 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
c11f691
typo
HarshaNalluru d91c8be
copy syncToken code from Richard's branch
HarshaNalluru c601bde
unit test for update sync token
HarshaNalluru f81f854
TODO: A future live test
HarshaNalluru 328f19e
changelog
HarshaNalluru 5fd38ce
remove potential live test
HarshaNalluru ceafaf1
api report
HarshaNalluru 15a910e
client["_syncTokens"] -> syncTokens
HarshaNalluru d10d9ec
JSDOCs
HarshaNalluru 83c5bbc
api report
HarshaNalluru 38e1148
Merge branch 'master' of https://github.com/Azure/azure-sdk-for-js in…
HarshaNalluru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1139,4 +1139,37 @@ describe("AppConfigurationClient", () => { | |
}); | ||
}); | ||
}); | ||
|
||
describe("syncToken", async () => { | ||
it("update sync token with eventgrid example", async () => { | ||
// Supposed to be a live test | ||
// TODO: | ||
// - Import eventgrid | ||
// - get sync token from eventgrid event | ||
// - call updateSyncToken | ||
// - call getConfigurationSetting | ||
// - assertion/check the retrieved setting | ||
|
||
// get sync token from EventGrid event (example event shown, based on .net sample) | ||
const eventGridEvent = { | ||
key: "key for setting", | ||
label: "label for setting", | ||
syncToken: "opaque sync token" | ||
}; | ||
|
||
// user treats token as an opaque value (note - this _does_ mutate the appconfigclient) | ||
// however, this mutations happens regardless since the system can and does return | ||
// sync token headers during normal operation. | ||
client.updateSyncToken(eventGridEvent.syncToken); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to check - there's nothing to test here. I'd remove this test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed |
||
|
||
// and now retrieving the value should be consistent with what happened | ||
// in EventGrid. | ||
const retrievedSetting = await client.getConfigurationSetting({ | ||
key: eventGridEvent.key, | ||
label: eventGridEvent.label | ||
}); | ||
|
||
console.log(retrievedSetting); | ||
}); | ||
}); | ||
}); |
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.
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.
You passed in
syncTokens
here so you don't need to delve into the object private fields to get it.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.
client["_syncTokens"] -> syncTokens