Skip to content

Conversation

@allison-truhlar
Copy link
Collaborator

Clickup id: 86acyvgzc
@krokicki @neomorphic

Restores how permission errors are handled and displayed in the file browser UI by removing the throwOnError: true global setting in the Tanstack Query Client. This was overring the query-specific error handling. Also fixes how the error is passed through the query, since passing both an error and data causes Tanstack Query dev tools to show errors in the dev console. Now, only data, no error, is passed.

Permission error handling improvements:

  • The useFileQuery hook now returns partial data with an errorMessage when a permission error (403) occurs, instead of throwing an error. This enables the UI to display folder information and a permission error message together. [1] [2]

Query client configuration:

  • The throwOnError option was removed from the React Query client configuration, since errors are now handled and displayed directly in the UI rather than being thrown to error boundaries.

- already handling errors in the queries, don't want to override this by throwing errors
- I was seeing this error in the console when navigating to a directory I didn't have permission to view: Error handling TanStack Query event: Error: An
unexpected error occurred. This was because the query was returning both fake minimal data (to preserve the breadcrumbs) as well as an error, which is not expected behavior by Tanstack Query. Now, 403 error messages are passed as data in the query, not in the error
@neomorphic
Copy link
Member

This looks like a good temporary fix. But as we discussed in the code review, it can probably reverted to just returning an error message, without data, when it fails. It should be possible to derive the bread crumbs from the url state, instead of relying on the server response.

Copy link
Member

@neomorphic neomorphic left a comment

Choose a reason for hiding this comment

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

See my previous comment

@allison-truhlar allison-truhlar merged commit 734c8a8 into initial-tanstack-query-test Nov 6, 2025
@allison-truhlar allison-truhlar deleted the bug-viewing-folder-without-permissions branch November 6, 2025 14:41
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