-
Notifications
You must be signed in to change notification settings - Fork 0
Tighten TypeScript strictness across renderer and main #155
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
Tighten TypeScript strictness across renderer and main #155
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const gitHubProviderPrototype = GitHubProvider.prototype as unknown as { | ||
| getLatestTagName: (this: GitHubProvider, cancellationToken?: unknown) => Promise<string>; | ||
| }; | ||
| const originalGetLatestTagName = gitHubProviderPrototype.getLatestTagName.bind(GitHubProvider.prototype); | ||
| gitHubProviderPrototype.getLatestTagName = async function (this: GitHubProvider, cancellationToken?: unknown) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve GitHubProvider instance when falling back
The override stores originalGetLatestTagName as gitHubProviderPrototype.getLatestTagName.bind(GitHubProvider.prototype). Because the function is already bound to the prototype, the later originalGetLatestTagName.call(this, …) ignores the instance this and executes with this === GitHubProvider.prototype, so this.options and this.httpRequest are undefined. Whenever both GitHub REST calls fail and the fallback is invoked, the updater will now throw before returning a tag name, breaking auto-update checks in offline or error scenarios. Store the unbound method instead so call(this) preserves the instance context.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68f71ef0b0448332ac72456ffa19147c