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: Disable guildMemberCache plugin temporarily #451

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions backend/src/plugins/Persist/PersistPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { GuildLogs } from "../../data/GuildLogs";
import { GuildPersistedData } from "../../data/GuildPersistedData";
import { makeIoTsConfigParser } from "../../pluginUtils";
import { trimPluginDescription } from "../../utils";
import { GuildMemberCachePlugin } from "../GuildMemberCache/GuildMemberCachePlugin";
import { LogsPlugin } from "../Logs/LogsPlugin";
import { RoleManagerPlugin } from "../RoleManager/RoleManagerPlugin";
import { zeppelinGuildPlugin } from "../ZeppelinPluginBlueprint";
Expand Down Expand Up @@ -31,7 +30,7 @@ export const PersistPlugin = zeppelinGuildPlugin<PersistPluginType>()({
configSchema: ConfigSchema,
},

dependencies: () => [LogsPlugin, RoleManagerPlugin, GuildMemberCachePlugin],
dependencies: () => [LogsPlugin, RoleManagerPlugin],
configParser: makeIoTsConfigParser(ConfigSchema),
defaultOptions,

Expand Down
6 changes: 4 additions & 2 deletions backend/src/plugins/Persist/events/StoreDataEvt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { PersistedData } from "../../../data/entities/PersistedData";
import { GuildMemberCachePlugin } from "../../GuildMemberCache/GuildMemberCachePlugin";
import { persistEvt } from "../types";

export const StoreDataEvt = persistEvt({
Expand All @@ -9,8 +8,11 @@ export const StoreDataEvt = persistEvt({
const config = await pluginData.config.getForUser(member.user);
const persistData: Partial<PersistedData> = {};

// FIXME: New caching thing, or fix deadlocks with this plugin
if (member.partial) {
return;
// Djs hasn't cached member data => use db cache
/*
const data = await pluginData.getPlugin(GuildMemberCachePlugin).getCachedMemberData(member.id);
if (!data) {
return;
Expand All @@ -22,7 +24,7 @@ export const StoreDataEvt = persistEvt({
}
if (config.persist_nicknames && data.nickname) {
persistData.nickname = data.nickname;
}
}*/
} else {
// Djs has cached member data => use that
const memberRoles = Array.from(member.roles.cache.keys());
Expand Down
5 changes: 2 additions & 3 deletions backend/src/plugins/availablePlugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { CustomEventsPlugin } from "./CustomEvents/CustomEventsPlugin";
import { GuildAccessMonitorPlugin } from "./GuildAccessMonitor/GuildAccessMonitorPlugin";
import { GuildConfigReloaderPlugin } from "./GuildConfigReloader/GuildConfigReloaderPlugin";
import { GuildInfoSaverPlugin } from "./GuildInfoSaver/GuildInfoSaverPlugin";
import { GuildMemberCachePlugin } from "./GuildMemberCache/GuildMemberCachePlugin";
import { InternalPosterPlugin } from "./InternalPoster/InternalPosterPlugin";
import { LocateUserPlugin } from "./LocateUser/LocateUserPlugin";
import { LogsPlugin } from "./Logs/LogsPlugin";
Expand Down Expand Up @@ -54,7 +53,7 @@ export const guildPlugins: Array<ZeppelinGuildPluginBlueprint<any>> = [
PostPlugin,
ReactionRolesPlugin,
MessageSaverPlugin,
GuildMemberCachePlugin,
// GuildMemberCachePlugin, // FIXME: New caching thing, or fix deadlocks with this plugin
ModActionsPlugin,
NameHistoryPlugin,
RemindersPlugin,
Expand Down Expand Up @@ -93,7 +92,7 @@ export const baseGuildPlugins: Array<ZeppelinGuildPluginBlueprint<any>> = [
GuildInfoSaverPlugin,
MessageSaverPlugin,
NameHistoryPlugin,
GuildMemberCachePlugin,
// GuildMemberCachePlugin, // FIXME: New caching thing, or fix deadlocks with this plugin
CasesPlugin,
MutesPlugin,
TimeAndDatePlugin,
Expand Down
Loading