Skip to content

Conversation

@PetalCat
Copy link
Collaborator

@PetalCat PetalCat commented Dec 9, 2025

No description provided.

@lishaduck lishaduck changed the base branch from main to pr-8 December 9, 2025 13:50
import { Compartment } from "@codemirror/state";
// ...
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// ...

Comment on lines +31 to +37
$effect(() => {
if (editorView) {
editorView.dispatch({
effects: extensionCompartment.reconfigure(extensions),
});
}
});
Copy link
Member

Choose a reason for hiding this comment

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

This won't work

Comment on lines +21 to +41
// ... existing imports ...
interface Props {
manager: LoroNoteManager | undefined;
notesList?: NoteOrFolder[];
user: User | undefined;
handleOpenInHomeserver: (input: string | null) => void;
noteId: string;
noteTitle: string;
}
let {
manager,
notesList = [],
user,
handleOpenInHomeserver,
noteId,
noteTitle,
}: Props = $props();
// ... (existing code) ...
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// ... existing imports ...
interface Props {
manager: LoroNoteManager | undefined;
notesList?: NoteOrFolder[];
user: User | undefined;
handleOpenInHomeserver: (input: string | null) => void;
noteId: string;
noteTitle: string;
}
let {
manager,
notesList = [],
user,
handleOpenInHomeserver,
noteId,
noteTitle,
}: Props = $props();
// ... (existing code) ...

Comment on lines -42 to -48
interface Props {
manager: LoroNoteManager | undefined;
notesList?: NoteOrFolder[];
user: User | undefined;
}
let { manager, notesList = [], user }: Props = $props();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
interface Props {
manager: LoroNoteManager | undefined;
notesList?: NoteOrFolder[];
user: User | undefined;
}
let { manager, notesList = [], user }: Props = $props();
interface Props {
manager: LoroNoteManager | undefined;
notesList?: NoteOrFolder[];
user: User | undefined;
handleOpenInHomeserver: (input: string | null) => void;
noteId: string;
noteTitle: string;
}
let {
manager,
notesList = [],
user,
handleOpenInHomeserver,
noteId,
noteTitle,
}: Props = $props();

Comment on lines 129 to 151
$effect(() => {
if (manager !== undefined && user !== undefined) {
const ephemeral = new EphemeralStore();
const undoManager = new UndoManager(manager.doc, {});
loroExtensions = LoroExtensions(
manager.doc,
{
ephemeral,
user: { name: user.username, colorClassName: "bg-primary" },
},
undoManager,
LoroNoteManager.getTextFromDoc,
);
return () => {
ephemeral.destroy();
};
} else {
loroExtensions = [];
return;
}
});
Copy link
Member

Choose a reason for hiding this comment

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

Does this really need an effect tho?

}
import ConfirmationModal from "./ConfirmationModal.svelte";
// ... (Props definition)
Copy link
Member

Choose a reason for hiding this comment

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

Are you kidding me?

const redirectTo = url.searchParams.get("redirectTo") || "/";
// Validate redirectTo to prevent open redirect attacks
const safeRedirect = redirectTo.startsWith("/") ? redirectTo : "/";
throw redirect(302, safeRedirect);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
throw redirect(302, safeRedirect);
redirect(302, safeRedirect);

Comment on lines +1 to +2
import { Database } from "bun:sqlite"; // or better, just use drizzle or direct sqlite driver if available
// Actually, I can rely on the app's db module if I run with vite-node
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
import { Database } from "bun:sqlite"; // or better, just use drizzle or direct sqlite driver if available
// Actually, I can rely on the app's db module if I run with vite-node

Copy link
Member

Choose a reason for hiding this comment

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

Do we still need all these? If yes, move them to scripts/.

Comment on lines +1 to +6
import { ed25519, x25519 } from "@noble/curves/ed25519.js";
import { xchacha20poly1305 } from "@noble/ciphers/chacha.js";
import { encodeBase64, decodeBase64 } from "@oslojs/encoding";
import { hkdf } from "@noble/hashes/hkdf.js";
import { sha256 } from "@noble/hashes/sha2.js";

Copy link
Member

Choose a reason for hiding this comment

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

Use HPKE (#6)

@lishaduck lishaduck mentioned this pull request Dec 11, 2025
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.

4 participants