Skip to content
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
47 changes: 0 additions & 47 deletions src/main.activateView.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,53 +377,6 @@ describe("PodNotes onload wiring (#55)", () => {
}
});

it("owns and disposes one capability-network service aggregate per plugin load", async () => {
const { plugin } = await loadPlugin();
const services = (
plugin as unknown as {
networkServices?: { status: string; dispose(): void; isDisposed(): boolean };
}
).networkServices;

expect(services?.status).toBe("available");
expect(services?.isDisposed()).toBe(false);

plugin.onunload();
loaded.splice(loaded.indexOf(plugin), 1);

expect(services?.isDisposed()).toBe(true);
expect(
(
plugin as unknown as {
networkServices?: unknown;
}
).networkServices,
).toBeUndefined();
});

it("keeps capability networking explicitly unavailable on mobile", async () => {
Object.assign(Platform, {
isDesktop: false,
isDesktopApp: false,
isIosApp: true,
isMobile: true,
isMobileApp: true,
isPhone: true,
});

const { plugin } = await loadPlugin();
const services = (
plugin as unknown as {
networkServices?: { status: string; reason?: string };
}
).networkServices;

expect(services).toMatchObject({
status: "unavailable",
reason: "unsupported-platform",
});
});

it("Show PodNotes command and ribbon icon both route to activateView", async () => {
const { commands, ribbonCalls, activateSpy } = await loadPlugin();

Expand Down
9 changes: 0 additions & 9 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ import {
PodNotesDataError,
} from "./persistence/podNotesData";
import { CredentialRepository } from "./services/CredentialRepository";
import {
createPodNotesNetworkServices,
type PodNotesNetworkServices,
} from "./services/PodNotesNetworkServices";

type MediaSessionActionName =
| "previoustrack"
Expand Down Expand Up @@ -83,7 +79,6 @@ export default class PodNotes extends Plugin implements IPodNotes {
// Store subscriptions tied to the plugin lifetime: settings persistence and
// queue automation. Disposed together in onunload.
private storeUnsubscribers: Unsubscriber[] = [];
private networkServices?: PodNotesNetworkServices;
private transcriptionService?: TranscriptionService;
private volumeUnsubscribe?: Unsubscriber;
private localFilesMirrorUnsubscribe?: Unsubscriber;
Expand Down Expand Up @@ -195,8 +190,6 @@ export default class PodNotes extends Plugin implements IPodNotes {

this.registerEvent(getContextMenuHandler(this.app));
this.registerMediaSessionHandlers();
this.networkServices = createPodNotesNetworkServices(this.app.secretStorage);

this.isReady = true;
}

Expand Down Expand Up @@ -419,8 +412,6 @@ export default class PodNotes extends Plugin implements IPodNotes {

override onunload() {
this.isUnloaded = true;
this.networkServices?.dispose();
this.networkServices = undefined;
this.clearLayoutReadyRetry();
this.clearMediaSessionHandlers();
for (const unsubscribe of this.storeUnsubscribers) unsubscribe();
Expand Down
92 changes: 0 additions & 92 deletions src/network/BufferedNetworkBody.ts

This file was deleted.

Loading