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

refactor: Cleanup DHC Service #171

Merged
merged 7 commits into from
Nov 13, 2024
Merged

refactor: Cleanup DHC Service #171

merged 7 commits into from
Nov 13, 2024

Conversation

bmingles
Copy link
Collaborator

@bmingles bmingles commented Nov 7, 2024

  • Refactored DhcService to be more consistent with patterns used by DheService
  • Psks are now stored in secret storage instead of keeping credentials in memory cache. They now behave similar to private keys in that one that has been saved will be automatically used when connecting to the server.

@bmingles bmingles requested a review from mofojed November 7, 2024 23:16
Copy link

github-actions bot commented Nov 8, 2024

End-to-end Test Summary

Tests 📝Passed ✅Failed ❌Skipped ⏭️Pending ⏳Other ❓Flaky 🍂Duration ⏱️
660000004:58:25
A ctrf plugin

Detailed Test Results

NameStatusmsFlaky 🍂
should default to the correct settingspassed ✅2315
should return custom settings: Empty configspassed ✅143
should return custom settings: Populated configspassed ✅89
should be able to load VSCodepassed ✅1041
should only be visible when a supported file type is active: test.groovypassed ✅2706
should only be visible when a supported file type is active: test.pypassed ✅979
A ctrf plugin

Failed Test Summary

No failed tests ✨

Flaky Test Summary

No flaky tests detected. ✨

@bmingles bmingles force-pushed the 151-cleanup-dhc-service branch from 1aa0986 to ce62ad4 Compare November 12, 2024 18:14
package.json Outdated
Comment on lines 222 to 227
"command": "vscode-deephaven.createCoreAuthenticatedClient",
"title": "Create Authenticated Client"
},
{
"command": "vscode-deephaven.createDHEAuthenticatedClient",
"title": "Create Authenticated Client"
Copy link
Member

Choose a reason for hiding this comment

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

Should these two actions have different titles?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Technically, the titles never show in the UI, but I've update for clarity.

Comment on lines +9 to +15
export class CoreJsApiCache extends ByURLAsyncCache<typeof DhcType> {
constructor() {
super(async url =>
initDhcApi(url, getTempDir({ subDirectory: urlToDirectoryName(url) }))
);
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Something I thought of here - technically, we should cache the API by the engine configuration, rather than the URL... as two workers could have the same API/configuration, but would host the API on separate URLs.
Also I have a refactoring on DHE for using the WebClientData from a Core+ worker, and part of that is the CorePlusManager for getting connections/clients and having it cached: https://github.com/deephaven-ent/iris/pull/2404/files#diff-f19e170fbd46d5fe67fdfc7daae3a0f97de914ae3a87a1e70633e6d7150b27da
Might be something we publish a common package that's used in both projects.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mofojed Workers store the respective api by the worker URL. Am I misunderstanding?

Copy link
Member

Choose a reason for hiding this comment

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

@bmingles Workers each have their own JS API URL, correct. However, in the case of DHE, you could have multiple workers that have the same worker kind configuration/engine; in which case you're just downloading the same JS API multiple times from different URLs. We optimize this in DHE by memoizing fetching the API on the worker kind/engine type: https://github.com/deephaven-ent/iris/blob/0fccc395d44974571e71085c762b68c151c7ca58/web/client-ui/src/main/AppMainContainer.tsx#L587

Copy link
Collaborator Author

@bmingles bmingles Nov 12, 2024

Choose a reason for hiding this comment

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

oh gotcha. Mind if I handle that in a separate PR to keep things cleaner? That's technically not a new concept introduced by this one, and it might be better to do after the jsapi fetch swap coming next.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@bmingles bmingles requested a review from mofojed November 12, 2024 21:42
@bmingles bmingles merged commit 40c77e3 into main Nov 13, 2024
3 checks passed
@bmingles bmingles deleted the 151-cleanup-dhc-service branch November 13, 2024 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants