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

Using manageState will fail in cronJob when the extension is locked #87

Open
Montoya opened this issue Jan 9, 2025 · 0 comments
Open

Comments

@Montoya
Copy link

Montoya commented Jan 9, 2025

This section of code from /snap/index.tsx:

export const onCronjob: OnCronjobHandler = async ({ request }) => {
  const wallet = await Wallet.getCurrentWallet();
  const mainnet_client = new Client("mainnet");
  const engine = new NotificationEngine(mainnet_client, wallet);
  switch (request.method) {
    case 'NotificationEngine':{
      console.log("notification check");
      await engine.checkForNotifications();
      return null;
    }
    default:
      throw new Error('Method not found.');
  }
};

Access encrypted state inside of a cronJob handler. If the extension is locked, then the extension will pop up a window for the user to unlock the extension. This is annoying because it will happen every time the cronJob fires. There are two solutions:

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

No branches or pull requests

1 participant