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: force guild recache from GUILD_CREATE #104

Merged
merged 1 commit into from
Nov 20, 2021

Conversation

swarley
Copy link
Member

@swarley swarley commented Nov 14, 2021

Summary

Adds an option to ensure_server to force the recache of a guild. This is necessary because there is a window in this cache lifecycle where we can have a server object with bad state that permanently occupies the cache.

image

Added

  • Cache#ensure_server - Add force_recache parameter to ensure guilds from GUILD_CREATE are used as the source of truth.

Changed

  • Server#update_data - Move data initialization logic from initialize to update_data for reusability.

Copy link
Member

@PanisSupraOmnia PanisSupraOmnia left a comment

Choose a reason for hiding this comment

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

The actual logic LGTM, just one docs nitpick from me.

lib/discordrb/cache.rb Show resolved Hide resolved
@swarley swarley merged commit 5c3ac3c into shardlab:main Nov 20, 2021
@swarley swarley deleted the fix/force-guild-recache branch November 20, 2021 03:10
swarley added a commit that referenced this pull request Nov 28, 2021
* fix: Define path when filename is given to send_file (#92)

* fix: Check roles method instead of role_ids

* refactor: Move View to webhooks (#103)

* refactor: Move View to webhooks
* fix: Use Webhooks::View::COMPONENT_TYPES
* fix: Correct use of positional argument in Webhook#execute
* fix: Add alias with deprecation notice

* feat!: Remove restricted channels check (#101)

* refactor: Use chunk_index and chunk_count to determine chunk status. (#102)

* refactor: Use chunk_index and chunk_count to determine chunk status.

* refactor: additional chunking changes

* fix: apply requested changes

* fix: force guild recache from GUILD_CREATE (#104)

* fix: rescue from internal errors instead of rest-client (#106)

* feat: v4.0 API client WIP

* feat: Add guild endpoints

* feat: webhook endpoints

* feat: Migrate to new API client internally

* refactor: Use faraday in discordrb/webhooks. Switch gateway JSON to use symbols

* refactor: Use faraday in discordrb/webhooks. Switch gateway JSON to use symbols

* refactor!: Remove unsupported API methods

* refactor!: Remove old API methods

* fix: Remove further references to rest-client
@Daniel-Worrall Daniel-Worrall added bug Something isn't working cache-issue labels Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cache-issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants