Skip to content

Conversation

@sejas
Copy link
Member

@sejas sejas commented Jun 3, 2025

Related issues

Proposed Changes

  • Fixed a bug where Cursor, Windsurf, and Webstorm were not returned when they were installed and no preferred editor was set.
  • Increase priority of Cursor over VSCode
  • Return a value when saving preferences instead of undefined.

When I added tests for useGetUserEditorQuery, I got these errors in the console. I didn't observe these errors in either the frontend or backend, but I think it's worth fixing them.

 console.error
    Error encountered handling the endpoint saveUserEditor.
                      `queryFn` returned an object containing neither a valid `error` and `result`. At least one of them should not be `undefined`
                      It needs to return an object with either the shape `{ data: <value> }` or `{ error: <value> }` that may contain an optional `meta` property.
                      Object returned was: { data: undefined }

      at executeRequest (node_modules/@reduxjs/toolkit/src/query/core/buildThunks.ts:330:21)
      at executeEndpoint (node_modules/@reduxjs/toolkit/src/query/core/buildThunks.ts:421:33)
      at node_modules/@reduxjs/toolkit/src/createAsyncThunk.ts:361:27

  console.error
    Error encountered handling the endpoint saveUserTerminal.
                      `queryFn` returned an object containing neither a valid `error` and `result`. At least one of them should not be `undefined`
                      It needs to return an object with either the shape `{ data: <value> }` or `{ error: <value> }` that may contain an optional `meta` property.
                      Object returned was: { data: undefined }

      at executeRequest (node_modules/@reduxjs/toolkit/src/query/core/buildThunks.ts:330:21)
      at executeEndpoint (node_modules/@reduxjs/toolkit/src/query/core/buildThunks.ts:421:33)
      at node_modules/@reduxjs/toolkit/src/createAsyncThunk.ts:361:27

Testing Instructions

  • Install Cursor
  • Remove other compatible IDEs
  • Make sure you don't have a preferredEditor on appdata.
  • Start Studio
  • Run npm start
  • Observe that the Cursor button appears on Studio. The same behavior will also work for any editor.
cursor-appears-if-only-editor-and-not-preferred-editor-on-appdata.mp4

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

@sejas sejas self-assigned this Jun 3, 2025
@sejas sejas requested review from a team and gavande1 June 3, 2025 10:23
@sejas sejas changed the title Add/stu 538 default editors Fix default editors when only one installed Jun 3, 2025
Copy link
Contributor

@epeicher epeicher left a comment

Choose a reason for hiding this comment

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

Thanks Antonio, this is working great! I have used a new VM only with Cursor and it displays the button as expected. I then uninstalled Cursor and installed Windsurf and it displayed the button too. LGTM! :shipit:

Only Cursor installed Only Windsurf installed
CleanShot 2025-06-03 at 13 25 20@2x CleanShot 2025-06-03 at 13 31 30@2x

@sejas sejas merged commit 13e8457 into trunk Jun 3, 2025
13 checks passed
@sejas sejas deleted the add/STU-538-default-editors branch June 3, 2025 11:37
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.

3 participants