Skip to content
Closed
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
9 changes: 5 additions & 4 deletions src/lib/components/filesharing/SendButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
const emailRegex =
/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/

let canEncrypt = $derived(() => {
let canEncrypt = $derived.by(() => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Code review] $derived$derived.by swap is semantically correct, but canEncrypt is never read in a reactive context — only consumed once inside startEncryption. The PR-description claim of a real reactivity bug overstates the impact; no user-visible behaviour changes from this hunk.

if (encryptState.files.length === 0) return false
const totalSize = encryptState.files.reduce((a, f) => a + f.size, 0)
if (totalSize >= MAX_UPLOAD_SIZE) return false

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Code review] Threshold mismatch with getValidationErrors on line 77: here totalSize >= MAX_UPLOAD_SIZE, there totalSize > effectiveLimit. At exactly MAX_UPLOAD_SIZE validation passes but canEncrypt is false, triggering the stranded-UI path at line 141. Pre-existing, worth fixing while here (flip to >).

Expand Down Expand Up @@ -138,7 +138,7 @@
await tick()

try {
if (!canEncrypt()) return
if (!canEncrypt) return

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Code review] Early return when !canEncrypt leaves encryptState.encryptionState stuck at EncryptionState.Sign (set on line 135) with no reset — the user sees the Yivi popup with no QR and no error. Either reset the state here or remove the check (it's already redundant with getValidationErrors() in onSign).


// Build recipients
const recipients = encryptState.recipients.map(
Expand All @@ -151,13 +151,14 @@
}
)

// Build sign method — email always included, other attributes optional
// Build sign method — email and full name always required so the
// recipient mail can show a real name; other attributes optional.
const sign = pg.sign.yivi({
element: '#crypt-irma-qr',
attributes: [
{
t: 'pbdf.gemeente.personalData.fullname',
optional: true,
optional: false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[Code review] Making pbdf.gemeente.personalData.fullname required locks out any sender without a Dutch municipality credential (foreign users, anyone who hasn't enrolled BRP). Intended per PR description, but there is no pre-flight i18n notice — affected users only see a generic Yivi disclosure failure with no explanation. Pair this with a src/lib/locales/{en,nl}.json copy update before merge.

},
{
t: 'pbdf.sidn-pbdf.mobilenumber.mobilenumber',
Expand Down