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: reloading the entire command store didn't fire ApplicationCommandRegistries #525

Merged
merged 3 commits into from Oct 2, 2022

Conversation

feefs
Copy link
Contributor

@feefs feefs commented Sep 4, 2022

CommandStore#loadAll() indirectly removes all application command registries. In addition, the Command's applicationCommandRegistry being readonly snapshots the command's old registry before it is removed.

As a result, application command registries won't handle api calls after reloading the command store more than once.

This is a hacky patch that gets the job done, so draft pr is only for visibility in hopes of reaching a better solution.

@vladfrangu vladfrangu marked this pull request as ready for review September 4, 2022 14:46
@vladfrangu vladfrangu changed the title fix: acrs not firing after reloading command store fix: reloading the entire command store didn't fire ApplicationCommandRegistries Sep 4, 2022
vladfrangu
vladfrangu previously approved these changes Sep 4, 2022
@favna
Copy link
Member

favna commented Sep 4, 2022

@sapphiredev pack

@sapphiredev
Copy link

sapphiredev bot commented Sep 4, 2022

Heya @favna, I've started to run the deployment workflow on this PR at 442e54b. You can monitor the build here!

@sapphiredev
Copy link

sapphiredev bot commented Sep 4, 2022

Hey @favna, I've released this to NPM. You can install it for testing like so:

npm install @sapphire/framework@pr-525

@vladfrangu
Copy link
Member

@sapphiredev pack

@sapphiredev
Copy link

sapphiredev bot commented Oct 1, 2022

Heya @vladfrangu, I've started to run the deployment workflow on this PR at 0d23cd1. You can monitor the build here!

@favna
Copy link
Member

favna commented Oct 1, 2022

Hey @vladfrangu, The bot has released this to NPM. You can install it for testing like so:

npm install @sapphire/framework@pr-525

@favna favna merged commit ad21eaa into sapphiredev:main Oct 2, 2022
r-priyam pushed a commit to r-priyam/sapphire-framework that referenced this pull request Oct 3, 2022
…dRegistries (sapphiredev#525)

* fix: reloading the entire command store didn't fire ApplicationCommandRegistries

* chore: smol fix

* chore: add note on current unload behavior for future changes

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
@developomp
Copy link

Sorry for the necro-bump, but the npm package for the sapphire framework still has the pr-525 tag which I think should be removed.

https://www.npmjs.com/package/@sapphire/framework?activeTab=versions

Screenshot from 2023-01-06 09-17-41

@favna
Copy link
Member

favna commented Jan 6, 2023

Apparently CI failed for this PR, thanks NPM API for being unpredictable af. https://github.com/sapphiredev/framework/actions/runs/3169108831

Just deprecated it manually. Thanks for informing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants