Skip to content

Conversation

@AbhiPrasad
Copy link
Member

A follow up to #102010 (comment) that converts the query param logic to use nuqs. Much nicer!

@AbhiPrasad AbhiPrasad requested a review from TkDodo October 24, 2025 16:13
@AbhiPrasad AbhiPrasad self-assigned this Oct 24, 2025
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 24, 2025
Comment on lines 398 to 401
to=""
onClick={e => {
e.preventDefault();
setShowDeprecatedDsn(showDeprecatedDsn ? null : true);
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if this is the best pattern, let me know if there's a better alternative!

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would keep the Link as it was and just not use the setter. The setter can be used instead of manually using navigate, but for links, this is fine:

<Link
  to={{
    query: {
      ...location.query,
      showDeprecated: showDeprecatedDsn ? undefined : 'true',
    },
 }}
>

Note that you don’t need to spread ...location into to, but you need to spread ...location.query. Long term I’d want to have a better pattern for this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done with b2ea1e1

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm CI seems to be failing because of re-rendering issues.

Cannot update a component (`ProjectKeyCredentials`) while rendering a different component (`NuqsTestingAdapter`). To locate the bad setState() call inside `NuqsTestingAdapter`, follow the stack trace as described in https://react.dev/link/setstate-in-render

I can't reproduce this locally though, so I'm not sure what the issue could be.

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's an issue with our testing adapter. I think @scttcper has a PR up to fix it though, maybe we should just merge that one?

Copy link
Member Author

Choose a reason for hiding this comment

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

sure - I'll wait to merge this PR until that is fixed then.

Copy link
Collaborator

Choose a reason for hiding this comment

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

huh I tried the test locally and it works fine for me on your PR 🤔

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be fixed on master, please update 🙏

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks for the reminder @TkDodo! Will update and merge

cursor[bot]

This comment was marked as outdated.

@codecov
Copy link

codecov bot commented Oct 24, 2025

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
12307 1 12306 10
View the full list of 1 ❄️ flaky test(s)
BalanceChangeAction re-enables form after error

Flake rate in main: 100.00% (Passed 0 times, Failed 4 times)

Stack Traces | 0.105s run time
Error: Unable to perform pointer interaction as the element inherits `pointer-events: none`:

DIV  <-- This element declared `pointer-events: none`
 DIV
  DIV
   SECTION
    FORM
     DIV
      BUTTON(label=Submit)  <-- Asserted pointer events here
    at Object.assertPointerEvents (.../sentry/node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.0/node_modules/@.../utils/pointer/cssPointerEvents.js:47:15)
    at Object.enter (.../sentry/node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.0/node_modules/@.../system/pointer/pointer.js:52:34)
    at PointerHost.move (.../sentry/node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.0/node_modules/@.../system/pointer/index.js:53:85)
    at pointerAction (.../sentry/node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.0/node_modules/@.../cjs/pointer/index.js:59:39)
    at Object.pointer (.../sentry/node_modules/.pnpm/@testing-library+user-event@14.6.1_@testing-library+dom@10.4.0/node_modules/@.../cjs/pointer/index.js:27:15)
    at Object.asyncWrapper (.../sentry/node_modules/.pnpm/@testing-library+react@16.2.0_@testing-library+dom@10.4.0_@types+react-dom@19.2.0_@type_011f94990cdc27509fa142ae9e3c3bf5/node_modules/@.../react/dist/pure.js:88:22)
    at Object.<anonymous> (.../gsAdmin/components/changeBalanceAction.spec.tsx:186:5)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

defaultValue: availableTabs[0]?.key ?? 'otlp',
}),
[availableTabs]
);
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Inconsistent Default Value Breaks Parser Behavior

The tabParser's defaultValue is 'otlp' when availableTabs is empty, but parseAsStringLiteral is configured with no valid keys. This inconsistency means the default value isn't accepted by the parser, potentially causing unexpected useQueryState behavior.

Fix in Cursor Fix in Web

@TkDodo
Copy link
Collaborator

TkDodo commented Nov 4, 2025

@AbhiPrasad tests are ✅ now, I think it’s good to merge

@AbhiPrasad AbhiPrasad merged commit a1eba23 into master Nov 10, 2025
47 checks passed
@AbhiPrasad AbhiPrasad deleted the abhi-nuqs-query-state-project-key branch November 10, 2025 21:18
Jesse-Box pushed a commit that referenced this pull request Nov 12, 2025
A follow up to
#102010 (comment)
that converts the query param logic to use `nuqs`. Much nicer!

---------

Co-authored-by: Dominik Dorfmeister <dominik.dorfmeister@sentry.io>
andrewshie-sentry pushed a commit that referenced this pull request Nov 13, 2025
A follow up to
#102010 (comment)
that converts the query param logic to use `nuqs`. Much nicer!

---------

Co-authored-by: Dominik Dorfmeister <dominik.dorfmeister@sentry.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants