Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update lattice.ts#38415

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
AfuroIsCrazy wants to merge1 commit intoMetaMask:main
base:main
Choose a base branch
Loading
fromAfuroIsCrazy:patch-1
Open

Conversation

@AfuroIsCrazy
Copy link

@AfuroIsCrazyAfuroIsCrazy commentedNov 29, 2025
edited by cursorbot
Loading

Note

Refactors the offscreen Lattice flow to open the connector tab, validate/parse credentials, detect tab closure, and consistently return results/errors with cleanup.

  • Offscreen Lattice flow (app/offscreen/lattice.ts):
    • Tab Opening: IntroducesopenConnectorTab(url: string): Promise<Window> with improved error messaging.
    • Message Listener: Reworksinit() to filter byOffscreenCommunicationTarget.latticeOffscreen, open the tab, and orchestrate response forwarding.
      • ValidatespostMessage origin/source/data againstKnownOrigins.lattice and the opened tab.
      • Parses credentials JSON and enforces required fields (deviceID,password).
      • Detects user-closing of the connector via interval and returns an error.
      • Centralized cleanup (interval + event listener) and error serialization beforesendResponse.
    • Types/Docs: Adds TypeScript typings and JSDoc annotations throughout.

Written byCursor Bugbot for commitddcb627. This will update automatically on new commits. Configurehere.

@github-actions
Copy link
Contributor

CLA Signature Action:

Thank you for your submission, we really appreciate it. We ask that you read and sign ourContributor License Agreement before we can accept your contribution. You can sign the CLA by just by adding a comment to this pull request with this exact sentence:

I have read the CLA Document and I hereby sign the CLA

By commenting with the above message you are agreeing to the terms of the CLA. Your account will be recorded as agreeing to our CLA so you don't need to sign it again for future contributions to this repository.

0 out of1 committers have signed the CLA.
@AfuroIsCrazy

window.addEventListener('message',onMessageListener,false);
})
.catch((error)=>{
// Handle tab opening failure (e.g., pop-up
Copy link

Choose a reason for hiding this comment

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

Bug: Missing return true breaks async sendResponse in Chrome

The Chrome extension message listener is missingreturn true; after the promise chain. When usingsendResponse asynchronously (inside.then() or.catch() callbacks), the listener must returntrue synchronously to keep the message channel open. Without it, Chrome closes the channel immediately after the listener returnsundefined, causing allsendResponse calls to silently fail. Other offscreen handlers in this codebase (likeledger.ts andtrezor.ts) correctly includereturn true; with explanatory comments referencing the Chrome API docs. Additionally, the file appears to be truncated mid-catch block, leaving the code syntactically incomplete.

Fix in Cursor Fix in Web

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@cursorcursor[bot]cursor[bot] left review comments

At least 2 approving reviews are required to merge this pull request.

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@AfuroIsCrazy@metamaskbot

[8]ページ先頭

©2009-2025 Movatter.jp