Skip to content
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

fix(PermissionOverwriteManager): mutates user #8282

Merged
merged 1 commit into from Jul 17, 2022

Conversation

AppEternal
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:
Prevent the mutation of the user/role as it's passed into upset.

The user passed into upset would always be of type "User" preventing the use of "GuildMember" in upset.

It's only noticed if you have User cache disabled and only wish to use guild member cache, this fixes that limitation by passing along the original data.

Status and versioning classification:

@vercel
Copy link

vercel bot commented Jul 14, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
discord-js ❌ Failed (Inspect) Jul 17, 2022 at 5:09PM (UTC)

@vercel vercel bot temporarily deployed to Preview July 14, 2022 00:31 Inactive
@Jiralite
Copy link
Member

Could you change the branch this is targeting to v13, please?

@Jiralite
Copy link
Member

This likely exists in the main branch too, so it'd be appreciated if a pull request could be opened there too!

@AppEternal AppEternal changed the title fix(PermissionOverwriteManager): 'edit' mutates user/role fix(PermissionOverwriteManager): mutates user Jul 14, 2022
@AppEternal
Copy link
Contributor Author

This likely exists in the main branch too, so it'd be appreciated if a pull request could be opened there too!

Done #8283

Since it's mutated the original Member object won't be passed to upset and will be seen as invalid if User cache is disabled.

Functions normally even with User cache disabled after the fix.
@vercel vercel bot temporarily deployed to Preview July 17, 2022 17:09 Inactive
@iCrawl iCrawl merged commit 4d86cf4 into discordjs:v13 Jul 17, 2022
@RedGuy12 RedGuy12 mentioned this pull request Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants