Skip to content

feat: improve user caching#387

Open
Droid00000 wants to merge 1 commit into
shardlab:mainfrom
Droid00000:fix/user-caching
Open

feat: improve user caching#387
Droid00000 wants to merge 1 commit into
shardlab:mainfrom
Droid00000:fix/user-caching

Conversation

@Droid00000
Copy link
Copy Markdown
Collaborator

Summary

Using Bot#ensure_user has a small problem. User objects that are cached aren't ever updated sans GUILD_MEMBER_UPDATE and PRESENCE_UPDATE events. For bots that can't use these events, this isn't good. For example, say someone runs a slash command, changes their nameplate, and then runs the command again. The cache won't be updated the second time the command is run, and we'll have stale data.

I think the most non-intrusive way to solve this is to introduce a force_cache argument, like we do with Bot#ensure_server. This way, we can update the cached object with new data if it already exists. Any other ideas and ways to solve this are welcome, this is just what I managed to come up with

Added

force_cache parameter to Bot#ensure_user

@Droid00000 Droid00000 force-pushed the fix/user-caching branch 2 times, most recently from 89908ab to 19d70f8 Compare November 23, 2025 06:15
@Droid00000 Droid00000 force-pushed the fix/user-caching branch 2 times, most recently from a45f255 to d29f9d9 Compare December 4, 2025 21:56
@Droid00000 Droid00000 force-pushed the fix/user-caching branch 6 times, most recently from 06435ce to f3b1b55 Compare April 13, 2026 02:57
@Droid00000 Droid00000 force-pushed the fix/user-caching branch 2 times, most recently from d9ddcc9 to 6056e0e Compare May 13, 2026 00:14
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.

1 participant