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

fulfill disconnect interface #56

Merged
merged 2 commits into from
Jun 28, 2024
Merged

fulfill disconnect interface #56

merged 2 commits into from
Jun 28, 2024

Conversation

turbocrime
Copy link
Contributor

@turbocrime turbocrime commented Jun 25, 2024

fulfill the disconnect interface published in@penumbra-zone/client@9

Copy link

changeset-bot bot commented Jun 25, 2024

🦋 Changeset detected

Latest commit: 4da58ad

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
chrome-extension Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@turbocrime turbocrime force-pushed the turbocrime/use-disconnect branch 2 times, most recently from 8b2f790 to 4f25eb4 Compare June 25, 2024 20:48
Copy link
Contributor Author

Choose a reason for hiding this comment

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

some mild reorganization

Copy link
Contributor Author

Choose a reason for hiding this comment

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

storage utilities moved to storage dir

@@ -22,6 +22,7 @@ export interface LocalStorageState {
frontendUrl: string | undefined;
passwordKeyPrint: KeyPrintJson | undefined;
fullSyncHeight: number | undefined;
// TODO: It's likely that an array is not the best data structure for this in storage. Should revisit later.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved this comment to the storage types definition

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the new handler

Copy link
Contributor Author

Choose a reason for hiding this comment

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

disconnect implementation

@turbocrime turbocrime requested review from grod220 and a team June 25, 2024 20:50
@turbocrime turbocrime force-pushed the turbocrime/use-disconnect branch 2 times, most recently from 80a738e to 4e1a17d Compare June 27, 2024 01:18
@@ -41,7 +40,7 @@
},
"web_accessible_resources": [
{
"resources": ["manifest.json"],
"resources": ["manifest.json", "favicon/*"],
Copy link
Contributor Author

Choose a reason for hiding this comment

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

expose the extension icon so dapps may use it

Copy link
Contributor Author

@turbocrime turbocrime Jun 27, 2024

Choose a reason for hiding this comment

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

injection is refactored into a class to more clearly and explicitly manage state.

the interface is async. so to provide the synchronous isConnected state querying method, the state of the three possible actions are tracked, and resolved in the private function state.

as expected, isConnected() => true would indicate an active connection.

more information on the interface is available in client package documentation, but what it comes down to is:

  • if no action has been attempted, the connection state is undefined.
  • if the page has called request but the request is still pending, the connection state is undefined.
  • if the page has called request but the request failed, the connection state is false.
  • if connection has succeeded, the connection state is true.
  • if the page has called disconnect, the connection state is false.

@grod220 grod220 mentioned this pull request Jun 27, 2024
17 tasks
@grod220
Copy link
Contributor

grod220 commented Jun 28, 2024

Going to take this PR over, rebase, and merge so we can cut a release given the proving key update

@grod220 grod220 merged commit 8b5a177 into main Jun 28, 2024
3 checks passed
@grod220 grod220 deleted the turbocrime/use-disconnect branch June 28, 2024 11:39
@turbocrime
Copy link
Contributor Author

thanks

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