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

Why is LiveShare * activated? #4470

Closed
TylerLeonhardt opened this issue Oct 21, 2021 · 12 comments
Closed

Why is LiveShare * activated? #4470

TylerLeonhardt opened this issue Oct 21, 2021 · 12 comments

Comments

@TylerLeonhardt
Copy link
Member

Describe the bug

When you are * activated, you compete with vscode for start up time and as a result, you hurt vscode's startup time in the process.

It's better to be reactive and only activate when the user interacts with your extension:

  • via a command
  • via a view being visible
  • etc

To Reproduce
Steps to reproduce the behavior:

  1. Go to vscode.dev
  2. install liveshare
  3. reload the window
  4. liveshare is activated

Expected behavior
It shouldn't activate until needed.

Additional context

Activation events for your reference (even though I know you know where these are)
https://code.visualstudio.com/api/references/activation-events

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Nov 20, 2021
@TylerLeonhardt
Copy link
Member Author

TylerLeonhardt commented Nov 20, 2021

Still would love to know why. This can help us improve the activation events of vscode.

@alyssajotice
Copy link
Contributor

alyssajotice commented Nov 30, 2021

Hey @TylerLeonhardt, I started looking into this issue. We are open to exploring activating Live Share upon a different activation event. However, Live Share has some scenarios where we need to reload VS Code and automatically reconnect to a Live Share session. One example of these scenarios is when a user joins a session as an anonymous user and then signs in during the session. To do this, we reload VS Code and upon reload, automatically rejoin them to the session as a signed-in user. For this scenario, we need to immediately activate Live Share, even if the user takes no action. Is there a way we could change our activation event for the majority of use cases while still keeping this behavior?

Also, is this a problem for vscode.dev, VS Code, or both?

@TylerLeonhardt
Copy link
Member Author

TylerLeonhardt commented Nov 30, 2021

@alyssajotice correct me if I'm wrong but wouldn't the activation event that you already have listed called onFileSystem:vsls trigger in the case you're talking about? When you reload that user will be attempting to open a vsls FileSystem

Also, is this a problem for vscode.dev, VS Code, or both?

Both. The Activation events work the same way in this case.

@alyssajotice
Copy link
Contributor

Thanks for the suggestion. Let me give it a try and I'll make sure it works.

@daytonellwanger
Copy link
Collaborator

The only necessity for Live Share activating on * that I know of is to support receiving a Live Share invitation. Live Share needs to be activated to establish a connection to the service and listen for these invitations. Of course, we could put this functionality behind a setting so that users could opt-out of receiving invites if they don't want Live Share always running.

@TylerLeonhardt
Copy link
Member Author

TylerLeonhardt commented Dec 6, 2021

Of course, we could put this functionality behind a setting so that users could opt-out of receiving invites if they don't want Live Share always running.

This would be my preference. When I use live share, I always am chatting with someone on Teams/Slack first and then they give me the LiveShare link that I open. I don't think I've ever invited someone out of the blue using LiveShare's tree view.

With that said, activation events are static so you could use a separate extension that maybe has this "always on" functionality.

  • Base live share extension that doesn't activate on *
  • "Always on" live share extension that activates on * (well actually onStartupFinished not *) and depends on the base live share extension to be activated

@alyssajotice alyssajotice removed their assignment Aug 5, 2022
@Trass3r
Copy link

Trass3r commented Aug 15, 2022

Any updates on this one?

@jramsay
Copy link
Member

jramsay commented Nov 29, 2022

@TylerLeonhardt: I was taking a look at this one. As a quick test I tried replacing "*" with:

activationEvents": [
"onFileSystemAccess:vsls",
"onFileSystem:vsls",
"onCommand:liveshare.*",
"onView:liveshare.*"
],

I noticed that the live share icon does not show up in the Activity Bar or Status Bar though until it is activated by invoking a liveshare command from the command palette. Is there a way to get these to show up without activating? Then if the user clicks on the icon in the Activity Bar, or invokes the share command from the Status Bar button, we can activate via the events listed above?

Before Activation:

image

After Activation:

image

@derekbekoe
Copy link
Collaborator

Linking to microsoft/vscode#167874

@jramsay
Copy link
Member

jramsay commented Dec 5, 2022

Moved away from * activation in the latest release: 1.0.5788. Replaced with onStartupFinished

@jramsay
Copy link
Member

jramsay commented Dec 14, 2022

Resolving this one as we are no longer * activated. We can track further optimizations with #167874

@jramsay jramsay closed this as completed Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants