Skip to content

Conversation

@peterwilsoncc
Copy link
Contributor

Ensures the user switching does not occur when attempting to switch to the same user with the user ID cast to a string.

Trac ticket: https://core.trac.wordpress.org/ticket/64628

Use of AI Tools

Nil.


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@github-actions
Copy link

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@peterwilsoncc peterwilsoncc marked this pull request as ready for review February 12, 2026 00:41
@github-actions
Copy link

github-actions bot commented Feb 12, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props peterwilsoncc, westonruter.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

/**
* Data provider for test_should_not_switch_to_same_user_type_equivalency.
*
* @return array[] Data provider.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @return array[] Data provider.
* @return array<string, array{ type_function: string }> Data provider.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@westonruter It's a little mixed but currently it seems common just to add the simplified docs for the data provider to avoid the need to double up docs with the @params in the function above it. For example c4d8047#diff-09a2e7959959d6a08ef07b1849e0178b853f7ef86f7885bbf9be2ed261145b24R4215

Copy link
Member

Choose a reason for hiding this comment

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

I don't feel strongly, but in new tests I've tried to be as explicit about the return types as possible. This makes it easier to understand at a glance what a data provider is expected to return, as opposed to analyzing the pattern in the data being returned. Granted, the data returned here is quite simple.

@peterwilsoncc peterwilsoncc force-pushed the fix/set-user-strict-comparison branch from ff67a3d to b3dfa06 Compare February 12, 2026 20:47
@peterwilsoncc peterwilsoncc force-pushed the fix/set-user-strict-comparison branch from b3dfa06 to a1836bc Compare February 13, 2026 00:41
@github-actions
Copy link

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 61633
GitHub commit: d3b793f

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions bot closed this Feb 13, 2026
@peterwilsoncc peterwilsoncc deleted the fix/set-user-strict-comparison branch February 13, 2026 02:47
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.

2 participants