-
Notifications
You must be signed in to change notification settings - Fork 145
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
Use UID instead of handle to identify extensions in app-watcher #5150
Use UID instead of handle to identify extensions in app-watcher #5150
Conversation
We detected some changes at packages/*/src and there are no updates in the .changeset. |
Coverage report
Show files with reduced coverage 🔻
Test suite run success2005 tests passing in 904 suites. Report generated by 🧪jest coverage report action from e433cf6 |
10ab3ae
to
66b63f7
Compare
@@ -150,11 +150,12 @@ | |||
this.directory = options.directory | |||
this.specification = options.specification | |||
this.handle = this.buildHandle() | |||
this.devUUID = `dev-${nonRandomUUID(this.handle)}` | |||
const uuidFromHandle = nonRandomUUID(this.handle) | |||
this.devUUID = `dev-${uuidFromHandle}` |
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.
If a valid UUID is not required here (because of the dev-
prefix), why can't we just use the handle directly?
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.
The dev-console and the remote-ui tool expect a UUID in this format (dev-{UUID}
)
@@ -221,8 +221,11 @@ export class FileWatcher { | |||
this.pushEvent({type: 'app_config_deleted', path, extensionPath, startTime}) | |||
} else if (isExtensionToml) { | |||
// When a toml is deleted, we can consider every extension in that folder was deleted. | |||
this.extensionPaths = this.extensionPaths.filter((extPath) => extPath !== extensionPath) | |||
this.pushEvent({type: 'extension_folder_deleted', path: extensionPath, extensionPath, startTime}) | |||
// We need to wait in case this is actually just moving folders around, not deleting them. |
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.
What happens if we don't wait? If it appears as removed and then as added, I don't think it's a big issue and also I guess it won't be very common. So maybe it's better to keep the code simpler.
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 was a request from the consistent-dev team, but it doesn't solve the issue completely, so I guess we can discard this change until I have a proper solution.
The goal is to detect folder movements and don't treat it as remove+add, because the deletion could be potentially dangerous if it reaches the server.
66b63f7
to
8a2b013
Compare
8a2b013
to
e433cf6
Compare
WHY are these changes introduced?
switch from using extension handles to UIDs as the primary identifier for extensions in the app watcher.
WHAT is this pull request doing?
How to test your changes?
Checklist