Skip to content
Open
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
2 changes: 1 addition & 1 deletion apps/draupnir/src/appservice/AppServiceDraupnirManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ export class AppServiceDraupnirManager {
local_part: mjolnirLocalPart,
owner: requestingUserID,
management_room: managementRoom.ok.toRoomIDOrAlias(),
} as MjolnirRecord;
};
await this.dataStore.store(record);
return Ok(record);
} else {
Expand Down
4 changes: 2 additions & 2 deletions apps/draupnir/src/commands/ProtectionsCommands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ export const DraupnirProtectionsConfigResetCommand = describeCommand({
const newSettings =
protectionDescription.protectionSettings.getDefaultConfig();
return await draupnir.protectedRoomsSet.protections.changeProtectionSettings(
protectionDescription as unknown as ProtectionDescription,
protectionDescription,
draupnir.protectedRoomsSet,
draupnir,
newSettings
Expand Down Expand Up @@ -517,7 +517,7 @@ export const DraupnirProtectionsCapabilityResetCommand = describeCommand({
);
}
return await draupnir.protectedRoomsSet.protections.changeCapabilityProviderSet(
protectionDescription as unknown as ProtectionDescription,
protectionDescription,
draupnir.protectedRoomsSet,
draupnir,
protectionDescription.defaultCapabilities
Expand Down
8 changes: 2 additions & 6 deletions apps/draupnir/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,7 @@ export function getUnknownPropertiesHelper(
} else {
const unknownSubProperties = getUnknownPropertiesHelper(
config[key],
defaultConfig[key] as Record<string, unknown>,
defaultConfig[key],
[...currentPathProperties, key]
);
unknownProperties.push(...unknownSubProperties);
Expand All @@ -609,11 +609,7 @@ export function getUnknownConfigPropertyPaths(config: unknown): string[] {
if (typeof config !== "object" || config === null) {
return [];
}
return getUnknownPropertiesHelper(
config,
defaultConfig as unknown as Record<string, unknown>,
[]
);
return getUnknownPropertiesHelper(config, defaultConfig, []);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class SynapseHTTPUserMayInvite {
}

unregisterListeners(): void {
this.synapseHTTPAntispam.userMayInviteHandles.unregisterHandle(
this.synapseHTTPAntispam.userMayInviteHandles.unregisterBlockingHandle(
this.synapseHTTPCallback
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
DeadDocumentJSX,
DocumentNode,
} from "@the-draupnir-project/interface-manager";
import { Result } from "@gnuxie/typescript-result";

function renderPermissions(
title: DocumentNode,
Expand Down Expand Up @@ -106,7 +105,7 @@ export function makeHandleMissingProtectionPermissions(
{renderMissingProtectionsPermissions(roomID, protectionPermissions)}
</root>,
{}
) as Promise<Result<undefined>>
)
);
};
}
3 changes: 1 addition & 2 deletions apps/draupnir/src/protections/ProtectedRoomsSetRenderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import {
import { StringRoomID } from "@the-draupnir-project/matrix-basic-types";
import { sendMatrixEventsFromDeadDocument } from "@the-draupnir-project/mps-interface-adaptor";
import { DeadDocumentJSX } from "@the-draupnir-project/interface-manager";
import { Result } from "@gnuxie/typescript-result";

// The callback that this is required for in MPS, is kinda silly and should
// really be `void` and not `Promise<void>`. If it wanted to be `Promise<void>`,
Expand All @@ -41,6 +40,6 @@ export async function renderProtectionFailedToStart(
<span>{error.message}</span>
</root>,
{}
) as Promise<Result<void>>
)
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ export class SynapseHTTPAntispamRoomExplorer implements RoomExplorer {
}.bind(this);

unregisterListeners(): void {
this.synapseHTTPAntispam.checkEventForSpamHandles.unregisterHandle(
this.synapseHTTPAntispam.checkEventForSpamHandles.unregisterNonBlockingHandle(
this.handleCheckEventForSpam
);
this.synapseHTTPAntispam.userMayInviteHandles.unregisterHandle(
this.synapseHTTPAntispam.userMayInviteHandles.unregisterNonBlockingHandle(
this.handleUserMayInvite
);
this.synapseHTTPAntispam.userMayJoinRoomHandles.unregisterHandle(
this.synapseHTTPAntispam.userMayJoinRoomHandles.unregisterNonBlockingHandle(
this.handleUserMayJoin
);
this.batcher.dispose();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export class JoinRoomsOnInviteProtection
this.draupnir.managementRoomID,
renderUnknownInvite(),
{}
) as Promise<ActionResult<undefined>>
)
);
}

Expand Down
2 changes: 1 addition & 1 deletion apps/draupnir/src/safemode/PersistentConfigEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class StandardPersistentConfigEditor implements PersistentConfigEditor {
}
relevantStatus.error = new ConfigParseError(
"There was a problem when using a property in the configuration.",
relevantStatus.description as unknown as ConfigDescription,
relevantStatus.description,
[cause.error],
relevantStatus.data
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ export class SpamCheckEndpointPluginManager<CBArguments extends unknown[]> {
this.nonBlockingHandles.add(handle);
}

public unregisterHandle(
handle: BlockingCallback<CBArguments> | NonBlockingCallback<CBArguments>
public unregisterBlockingHandle(handle: BlockingCallback<CBArguments>): void {
this.blockingHandles.delete(handle);
}

public unregisterNonBlockingHandle(
handle: NonBlockingCallback<CBArguments>
): void {
this.blockingHandles.delete(handle as BlockingCallback<CBArguments>);
this.nonBlockingHandles.delete(handle as NonBlockingCallback<CBArguments>);
this.nonBlockingHandles.delete(handle);
}
Comment on lines -39 to 47
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But why?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Rules changed and the original way this file was written violates lint rules. I only have the exact lint error from after the fix was run.


public unregisterListeners(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
//
// SPDX-License-Identifier: AFL-3.0

import { StringUserID } from "@the-draupnir-project/matrix-basic-types";
import { readTestConfig, setupHarnessWithConfig } from "../utils/harness";
import { newTestUser } from "../../integration/clientHelper";
import { MjolnirAppService } from "../../../src/appservice/AppService";
Expand All @@ -18,8 +17,7 @@ describe("Managed room bootstrap startup integration", function (this: Mocha.Sui
...(config as unknown as Record<string, unknown>),
};
testConfigRecord.adminRoom = undefined;
testConfigRecord.initialManager =
(await initialManager.getUserId()) as StringUserID;
testConfigRecord.initialManager = await initialManager.getUserId();
const testConfig = testConfigRecord as typeof config;

let appservice: MjolnirAppService | undefined;
Expand Down
Loading
Loading