Save data in the UI per Hypervisor PK #1329
Merged
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.
Did you run
make format && make check
?The go code was not changed.
npm run lint
andnpm run build
were used.Changes:
This prevents problems when testing with different hypervisor PKs in the same machine and any situation in which the hypervisor PK is changed but the URL stays the same.
How to test this PR:
Open the Skywire manager and VPN UI in the browser and make some changes (like adding labels to a transport or selecting a VPN server). After that, change the hypervisor PK but not the URL (you can create a new config file for the hypervisor just for the test).
Using the previous version, the UI shows for the second hypervisor the same data saved for the first hypervisor (same custom labels and same selected VPN server), as the data is saved only associated with the URL used for accessing the UI. With the changes on this PR, the data saved for the first hypervisor will not be available for the second one, as the data is saved assiciated with the URL and also with the PK of the hypervisor. If you return to the first hypervisor PK, its data is available again.
NOTE: the first time you open the UI with the changes on this PR, all old data is migrated to the new format and associated with the PK of the hypervisor you are using at that time.