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: Ensure guild settings exist in DB before updating #999

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

FoxxMD
Copy link
Contributor

@FoxxMD FoxxMD commented Feb 14, 2024

If a user:

  • runs muse and adds the bot to their guild
  • deletes database (EX recreates docker container)
  • runs muse and tries to update config before doing anything else

Then muse tries to update settings that were not created since guild-create event was not fired due to bot already existing in user's guild.

Fix this by always getting/creating guild settings before updating any from config command

If a user switches branches or changes schema.prisma without running `npm install` the generated client will be out of sync with the schema. Adding a npm run script makes doing this easier without needing to have primsa installed globally.
If a user:

* runs muse and adds the bot to their guild
* deletes database (EX recreates docker container)
* runs muse and tries to update config before doing anything else

Then muse tries to update settings that were not created since guild-create event was not fired due to bot already existing in user's guild.

Fix this by always getting/creating guild settings before updating any from config command
Copy link

📦 A new release has been made for this pull request.

To play around with this PR, pull codetheweb/muse:pr-999 or codetheweb/muse:4dbfd46460c6516d73d6d9056219a0fbcf1f198f.

Images are available for x86_64 and ARM64.

Latest commit: 4dbfd46

@codetheweb codetheweb merged commit 1d5729f into museofficial:master Feb 17, 2024
5 checks passed
@codetheweb
Copy link
Collaborator

thanks!

Copy link

github-actions bot commented Mar 3, 2024

🚀 Released in Release v2.6.0.

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