We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The addition of category support within server channels has created a serialisation problem linked to non-existent channels within the cache.
├── root │ └── user-[user_id] │ └── server-[server_id] │ └── server-[server_id]/emoji-[emoji_id] │ └── server-[server_id]/member-[emoji_id]
final class Marshaller { // Cache structure Map<String, dynamic> _cache = {}; Future<void> putServer(Server server) async { final rawServer = serializers.servers.deserialize(server); _cache.put('server-${server.id}', rawServer); for (final role in server.roles.list) { final rawRole = await serializers.roles.deserialize(role) _cache.put('server-${server.id}/role-${role.id}', rawRole); } for (final emoji in emojis.list) { final rawEmoji = await serializers.emojis.deserialize(emoji) _cache.put('server-${server.id}/emoji-${emoji.id}', rawEmoji); } } Future<({ Server? instance, Map<String, dynamic>? struct })> getServer(String id) async { final cachedServer = await _cache.getOrFail('server-$id'); return ( instance: cachedServer != null ? await serializers.servers.cacheSerializer(cachedServer) : null, struct: cachedServer ); } }
├── <channel> │ └── id │ └── name │ └── Map<Snowflake, User> users
├── Server │ └── id │ └── name │ └── List<Snowflake> members │ └── List<Snowflake> channels
abstract interface class Serializer<T> { T remoteSerializer(Map<String, dynamic>); T cacheSerializer(Map<String, dynamic>); Map<String, dynamic> deserialize(T); }
The text was updated successfully, but these errors were encountered:
LeadcodeDev
Successfully merging a pull request may close this issue.
Context
The addition of category support within server channels has created a serialisation problem linked to non-existent channels within the cache.
Proposal
Cache structure
Cached data structures
Channel
Server
Serializers
The text was updated successfully, but these errors were encountered: