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

One setting created firstly disappears after refreshing the "Application Settings" node if add two settings at the same time previously #815

Open
v-xinda opened this issue Mar 31, 2023 · 3 comments
Labels
AT-CTI Created by CTI team bug Something isn't working
Milestone

Comments

@v-xinda
Copy link

v-xinda commented Mar 31, 2023

OS: Win 10
Azure Resources extension: v0.6.3-alpha.0
Static Web Apps Extension Version: 20230330.4
Regression: Not a regression

Repro Steps:

  1. Create a static web app -> Expand it -> Expand "Production" node -> Expand "Application Settings" node.
  2. Right click "Application Settings" node -> Click "Add New Setting..." -> Enter a name and value.
  3. Add a new setting again immediately (Make sure there are two "Creating xxx..." at the same time).
  4. Refresh the "Application Settings" node after two settings have been created.
  5. Check whether two settings don't disappear.

Expect:
Two settings don't disappear.

Actual:
One setting created firstly disappears.
actual

@v-xinda v-xinda added the AT-CTI Created by CTI team label Mar 31, 2023
@v-xinda v-xinda changed the title One setting created firstly disappears after refreshing the "Application Settings" node One setting created firstly disappears after refreshing the "Application Settings" node if add two settings at the same time previously Mar 31, 2023
@alexweininger
Copy link
Member

Does the setting come back if you refresh again? Does the setting show up on the portal?

@v-xinda
Copy link
Author

v-xinda commented Apr 6, 2023

@alexweininger The setting doesn't come back after refreshing again, and the setting doesn't show up on the portal.

@nturinski
Copy link
Member

This is probably happening it because when we're updating the app settings, we're sending the whole JSON payload.

So when request 1 starts updating, request 2 is GETing the old app settings (which don't include setting 1 yet) and then sends a new JSON payload only consisting of setting 2 which immediately overwrite it.

There's a couple of ways that we can handle this:

  • Just block updating when there are other app setting updates occurring
  • Cache the new settings JSON while it's updating. If there are any new requests that come in while that's occurring, just the cached JSON rather than getting it from the remote Azure resource.

@nturinski nturinski added the bug Something isn't working label Apr 12, 2023
@nturinski nturinski added this to the Backlog milestone Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AT-CTI Created by CTI team bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants