Skip to content

Update flush-dns extension #18964

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

Merged
merged 7 commits into from
Jun 17, 2025
Merged

Update flush-dns extension #18964

merged 7 commits into from
Jun 17, 2025

Conversation

c0b41
Copy link
Contributor

@c0b41 c0b41 commented May 5, 2025

Description

Screencast

Checklist

@raycastbot raycastbot added extension fix / improvement Label for PRs with extension's fix improvements extension: flush-dns Issues related to the flush-dns extension labels May 5, 2025
@raycastbot
Copy link
Collaborator

raycastbot commented May 5, 2025

Thank you for your contribution! 🎉

🔔 @rasmusbe @tombonez you might want to have a look.

You can use this guide to learn how to check out the Pull Request locally in order to test it.

You can expect an initial review within five business days.

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR updates the flush-dns extension to support Windows platform while modifying the DNS cache flushing functionality for both macOS and Windows operating systems.

  • Title in extensions/flush-dns/package.json should be "Flush DNS" (not "Flush Dns") since DNS is an acronym
  • The launchCommand in extensions/flush-dns/src/index.ts should be wrapped in a try-catch block
  • Consider using showFailureToast from @raycast/utils instead of custom error handling in handleExecutionError function
  • Recommend adding a subtitle "System" to the command in package.json for better context
  • Windows-specific error handling in handleExecutionError could be simplified by using showFailureToast

💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!

2 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile

@@ -1,7 +1,7 @@
{
"$schema": "https://www.raycast.com/schemas/extension.json",
"name": "flush-dns",
"title": "Flush DNS",
"title": "Flush Dns",
Copy link
Contributor

Choose a reason for hiding this comment

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

style: 'Flush Dns' should be 'Flush DNS' since DNS is an acronym

Suggested change
"title": "Flush Dns",
"title": "Flush DNS",

switch (osPlatform) {
case "darwin":
{
const macResult = getMacOSCommands(osCommandSet);
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: getMacOSCommands is called without await but returns a Promise

Suggested change
const macResult = getMacOSCommands(osCommandSet);
const macResult = await getMacOSCommands(osCommandSet);

c0b41 and others added 2 commits May 5, 2025 16:45
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Copy link
Contributor

@rasmusbe rasmusbe left a comment

Choose a reason for hiding this comment

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

Great addition! I'm unable to try the Windows part it since I only own a mac, but it looks valid. 👏

I haven't verified that the mac parts still work, I will be able to do that on Thursday since I'm not having access to my development computer until then but I've added some small feedback based on what I see in the code.

"title": "Flush DNS",
"title": "Flush Dns",
Copy link
Contributor

Choose a reason for hiding this comment

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

'Flush Dns' should be 'Flush DNS' since DNS is an acronym

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Linter was complaining, that why i changed

Copy link
Collaborator

Choose a reason for hiding this comment

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

I will look into this, let's use DNS for sure :)

commands: {
ipconfig: "ipconfig /flushdns",
},
shell: undefined, // Uses cmd.exe by default
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be undefined or "cmd.exe" in that case. Feels like cmd.exe is making more sense, but I don't have a strong opinion regarding this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

raycast windows don't have showHUD api right so hard to know if throwing error, but Nodejs docs says right here node uses process.env.ComSpec as default shell as cmd.exe

@c0b41
Copy link
Contributor Author

c0b41 commented May 10, 2025

i dont see any lint error locally is ci bugged or something? @pernielsentikaer

@pernielsentikaer pernielsentikaer added the status: blocked by API The issue cannot be resolved because of incompleteness of the API label May 12, 2025
@pernielsentikaer
Copy link
Collaborator

Should be better now @c0b41 - I'll leave this until we have support for everything that this extension uses

@c0b41
Copy link
Contributor Author

c0b41 commented May 12, 2025

everything working on windows side, but someone should test macos stuff again, i hope i didn't break anything

@pernielsentikaer
Copy link
Collaborator

@rasmusbe did you have a chance to test it yet?

@c0b41
Copy link
Contributor Author

c0b41 commented Jun 6, 2025

can someone test this changes

@pernielsentikaer
Copy link
Collaborator

This will be reviewed by our Windows team when they are ready

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Additional updates to the Flush DNS extension's Windows support implementation and documentation.

  • The CHANGELOG.md entry correctly follows format with {PR_MERGE_DATE} template and proper placement at the top
  • While adding Windows support in package.json, maintainers should review extensive Windows-specific code changes in index.ts for platform-specific command execution
  • Code modularization with separate functions improves maintainability but needs security review for Windows command execution

3 files reviewed, no comments
Edit PR Review Bot Settings | Greptile

Copy link
Contributor

@rasmusbe rasmusbe left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, I have tested it now on Mac, and it still works as it should. Great job @c0b41!

@raycastbot raycastbot merged commit af7bfe9 into raycast:main Jun 17, 2025
2 checks passed
Copy link
Contributor

Published to the Raycast Store:
https://raycast.com/rasmusbe/flush-dns

@raycastbot
Copy link
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension fix / improvement Label for PRs with extension's fix improvements extension: flush-dns Issues related to the flush-dns extension status: blocked by API The issue cannot be resolved because of incompleteness of the API Windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants