Skip to content

Use context.storageUri for session file (and refactor) #4088

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

Merged
merged 8 commits into from
Jul 21, 2022

Conversation

andyleejordan
Copy link
Member

This is a decent cleanup of our session file logic in the client, so it needs a close review. Most important note is that I completely removed writeSessionFile...and everything works as expected in my testing. Which I think makes sense, as we pass the session file path to the server and expect it to write the session file. I don't know why we had the client ever writing a session file. Furthermore, the only reference I can find to it in the server is with a writer, no reader. 🤷

Related to #4071.

@andyleejordan andyleejordan added Issue-Enhancement A feature request (enhancement). Area-Engine labels Jul 20, 2022
@andyleejordan andyleejordan marked this pull request as ready for review July 20, 2022 22:25
@andyleejordan andyleejordan requested a review from a team July 20, 2022 22:25
debugServicePipeName: string;
}

export type IReadSessionFileCallback = (details: IEditorServicesSessionDetails) => void;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find what this was used for...delete it?

@andyleejordan andyleejordan force-pushed the andschwa/session-path branch from ec15a0a to 1eb62cd Compare July 20, 2022 22:29
Note that we seemed to be unnecessarily writing a new debug session file
for the `RunCode` and `PesterTests` features; they work fine without
that logic as the debugger itself handles the session file.
No idea why we were writing it as the client. Maybe I've totally
misunderstood, but everything works as expected without this (and
moreover, we delete any existing session file and then wait for it,
after passing the path to the server).
As that's the only place they're used.
Since `cwd` can be `undefined` we need to use optional chaining.
@andyleejordan andyleejordan force-pushed the andschwa/session-path branch from 1eb62cd to 5f80a6e Compare July 21, 2022 15:37
Copy link
Collaborator

@SeeminglyScience SeeminglyScience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I think originally it used to write the session file first and wait for it to be populated... something like that? Can't remember if it was a strange limitation of the time or just accidental over engineering but either way can probably just be dropped 😁

@andyleejordan andyleejordan merged commit 697e1e2 into main Jul 21, 2022
@andyleejordan andyleejordan deleted the andschwa/session-path branch July 21, 2022 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Engine Issue-Enhancement A feature request (enhancement).
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants