Skip to content

Fix(vault): a note made again under a deleted note's name gets its own date on Windows - #55

Merged
adibhanna merged 1 commit into
mainfrom
fix/creation-date-tunneling
Nov 20, 2026
Merged

adibhanna merged 1 commit into
mainfrom
fix/creation-date-tunneling

Conversation

@adibhanna

Copy link
Copy Markdown
Contributor

On NTFS a file created under a name deleted in the last 15 seconds gets the deleted file's birthtime back (file system tunneling). A new note left its creation date to that birthtime, and its first save wrote the old date into the sidecar for good.

writeNoteFileAtomic now records now in .zennotes/note-metadata/<rel>.metadata.json when the note does not exist yet, replacing any record an earlier note of the name left behind. A note created outside zn still falls back to birthtime.

Test: TestNewNoteRecordsItsOwnCreationDate (CreateNote and WriteNote) fails without the fix (recorded createdAt = 0) and passes with it. Same fix as the desktop app's (ZenNotes/zennotes v2.90.0, bf4f86c4).

…n date on Windows

NTFS hands a file created or renamed into a name deleted in the last
15 seconds the old file's birthtime (file system tunneling). zn cleared
a new note's creation record and left its date to that birthtime, so a
note deleted and made again under the same name showed the old note's
date, and its next save wrote that date into the record for good. The
desktop app had the same gap and closes it in the same change.

writeNoteFileAtomic, which every note write goes through (CreateNote,
WriteNote, the MCP tools), now records now as the creation date when
the note does not exist yet, replacing any record an earlier note of
the name left. A note that exists keeps the date it had, as before. A
note made outside zn still falls back to the file's times.

TestNewNoteRecordsItsOwnCreationDate fails without the fix: the record
is missing right after CreateNote and after a first WriteNote.
@adibhanna
adibhanna merged commit 8b0582a into main Nov 20, 2026
7 checks passed
renovate Bot added a commit to scottames/copr that referenced this pull request Nov 21, 2026
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [ZenNotes/zennotes](https://redirect.github.com/ZenNotes/zennotes) |
minor | `2.88.0` → `2.90.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the [Dependency
Dashboard](../issues/3) for more information.

---

### Release Notes

<details>
<summary>ZenNotes/zennotes</summary>

###
[`v2.90.0`](https://redirect.github.com/ZenNotes/zennotes/releases/tag/v2.90.0):
ZenNotes v2.90.0

[Compare
Source](https://redirect.github.com/ZenNotes/zennotes/compare/v2.89.0...v2.90.0)

ZenNotes 2.90.0 fixes a creation-date bug on Windows: a note you delete
and make again under the same name now gets its own date instead of the
deleted note's. The desktop app also bundles zn 0.18.1, which has the
same fix, and renders math with KaTeX 0.19.1.

Released from
[`b1895548`](https://redirect.github.com/ZenNotes/zennotes/commit/b1895548261e5ed3550d76921daae1cb4f3cd500)
through
[#&#8203;1101](https://redirect.github.com/ZenNotes/zennotes/pull/1101)
on 2026-11-20.

#### Fixes

- **A note made again under a deleted note's name gets its own date on
Windows.** Windows keeps a deleted file's creation time for about 15
seconds and gives it to the next file created under the same name (NTFS
calls this file system tunneling). ZenNotes read a new note's date from
the file, so a note deleted and made again right away showed the old
note's date, and its first save wrote that date down for good. Every way
the app makes a note now records its creation date the moment it makes
it: a new note or drawing, an Obsidian drawing conversion, an import, a
duplicate, and notes the MCP server creates or duplicates. A note
created outside ZenNotes still takes its date from the file. Temporary
folder sessions are unchanged and still get no `.zennotes/` folder.

- **Math renders with KaTeX 0.19.1.** The 0.16 line had a low-severity
advisory
([GHSA-238p-pmpm-9mq7](https://redirect.github.com/advisories/GHSA-238p-pmpm-9mq7)):
prototype pollution already present in a page could turn on KaTeX
options the app leaves off. Formulas look the same; equation numbers,
matrices, aligned blocks and struck math were checked in Edit and
Preview.

#### zn

- **The desktop app bundles zn 0.18.1**
([ZenNotes/tui#55](https://redirect.github.com/ZenNotes/tui/pull/55)),
which records a new note's date the same way, in `zn create`, `zn
write`, `zn capture` and `zn mcp`. A desktop-managed `zn` already
updates itself; this raises the version a fresh install starts from.

#### Phones

- **iPhone 1.43.0 and Android 1.1.62** carry the shared core of this
release. The date fix is for Windows, so the one change there is math
rendering with KaTeX 0.19.1.

#### For contributors

- **`startNoteCreation(root, rel)`** in
`apps/desktop/src/main/note-creation-metadata.ts` is what a creation
path calls now, instead of removing the sidecar. It writes `{version: 1,
createdAt: now}` to `.zennotes/note-metadata/<rel>.metadata.json`
atomically (fsynced temp file, then rename) and skips ephemeral roots.
zn's `writeNoteFileAtomic` does the same when the note does not exist
yet.
- **Windows CI keeps the tests' scratch vaults on the runner's work
disk.** `os.tmpdir()` on a Windows runner is on the C: system disk while
the checkout is on D:, and one MCP task update fsyncs four files, which
took a 25 ms test past vitest's 5 s limit on a slow runner. The Build
job now points `TEMP` and `TMP` at `RUNNER_TEMP`.
- **One KaTeX for the whole tree.** rehype-katex,
micromark-extension-math and mermaid still ask for katex ^0.16.0, so a
root `overrides` entry moves them to 0.19.1 with everything else. KaTeX
0.18 prefixed its internal classes: an equation number is `.katex-tag`
now, not `.tag`. A custom theme that styled KaTeX internals needs the
new names; `.katex` and `.katex-display` are unchanged.
- **The ordered-list tests hand Enter the finished parse.**
`ensureSyntaxTree` finishes the parse in the language state's context,
but `syntaxTree(state)` keeps returning the tree the state was created
with; an empty transaction (`state.update({}).state`) adopts the
finished one.

#### Verification

How to test locally, on Windows:

1. Open a vault in ZenNotes and create a note named `Tunnel test`. Note
the date in its info.
2. Wait a minute, then delete it permanently (empty it from the Trash).
3. Within 15 seconds, create a new note named `Tunnel test` and type a
line.
4. Before: the new note showed the first note's creation date, and kept
it after a save and a relaunch. After: it shows the moment you made it,
and keeps that after a save and a relaunch.
5. The same with `zn`: `zn create --title "Tunnel test" --body first`,
`zn delete "inbox/Tunnel test.md" --yes`, `zn create --title "Tunnel
test" --body second`, then `zn list --limit 1 --json`: `createdAt` is
the second create.

#### Distribution channels

- **GitHub:** this release, latest, with all five update feeds. Every
file they name was checked, and the app in both macOS DMGs is Notarized
Developer ID and stapled.
- **AUR:** `zennotes-bin 2.90.0-1`, pinned to the Linux tarball's
SHA-256 `b3dbcafd…99b525`.
- **Homebrew:** the `zennotes` cask in ZenNotes/homebrew-tap
(`d2baec7`).
- **Nix:** `packaging/nix/release-data.json` (`aab158fc`), built on
`main` (run
[`4482970`](https://redirect.github.com/ZenNotes/zennotes/commit/44829703200)).
- **nixpkgs:**
[NixOS/nixpkgs#590905](https://redirect.github.com/NixOS/nixpkgs/pull/590905),
now `zennotes-desktop: 2.88.0 -> 2.90.0`, waiting for nixpkgs review.
- **Self-hosted server and Docker:** unchanged; server 2.84.1 is
current.
- **zn:**
[0.18.1](https://redirect.github.com/ZenNotes/tui/releases/tag/v0.18.1),
released first and bundled here; the Homebrew `zn` formula is on 0.18.1
too.
- **Phones:** iPhone 1.43.0 is Waiting for Review on the App Store.
Android 1.1.62 is in review on Google Play, and its [GitHub
release](https://redirect.github.com/ZenNotes/zennotesandroid/releases/tag/v1.1.62)
carries Play's signed universal APK. Both carry the shared core
`core-2.90.0-core.h7d82a7cbcca39312`, published as a pre-release.
- **Website:** the release page on zennotes.org, zn 0.18.1 on the CLI
releases page, and the CLI version in the docs.

#### Release validation

- On `b1895548`: typecheck, every test suite uncached (shared-domain
2715, portable-vault 398, app-core 4949, quicklook 18, web 76, desktop
1964), `build:prod`, `npm run pack` and the packaged launch check (page
target, rendered, 2.90.0, bundled zn 0.18.1), and the three smoke
suites. No hazards, no audit findings at any level, no long dashes.
- The creation-date fix has tests that fail on the old code, in the app,
the MCP server and zn: each fakes NTFS tunneling by handing the
recreated file the deleted note's birthtime. It was not run on a real
NTFS disk.
- The gate found two things before the cut. `npm audit` listed seven low
findings, all one KaTeX advisory: KaTeX moved to 0.19.1 everywhere, and
math was driven in the built app (inline, struck, numbered, matrices,
aligned, underbrace; Edit and Preview) and on both phones. Then one
app-core test timed out once under load (a hover preview measured at 190
ms against a 1 s wait); its wait is now 5 s. Every check ran again on
the final commit.
- Windows CI: with the tests' scratch files on the runner's work disk,
Windows x64 passed on the first try on both runs of the release pull
request and on `main`, the job that timed out on `main` after 2.89.0.
- The phones were walked on the release builds before either store,
fresh installs: iPhone 1.43.0 on an iOS 27.2 simulator and Android
1.1.62 on an emulator, with onboarding, a new note, the remote vault
step and a note of math. The Android pull request's emulator job could
not boot on a runner without hardware acceleration (twice), so the local
walk stood in for it. The iPhone Cloud UI tests were skipped (no Cloud
change).
- Not tested before release: packaged Windows and Linux builds beyond
CI, and the date fix on a real Windows disk.

###
[`v2.89.0`](https://redirect.github.com/ZenNotes/zennotes/releases/tag/v2.89.0):
ZenNotes v2.89.0

[Compare
Source](https://redirect.github.com/ZenNotes/zennotes/compare/v2.88.0...v2.89.0)

ZenNotes 2.89.0 reaches a self-hosted server behind Cloudflare Access or
any other gateway that checks headers. The desktop app, `zn` and the MCP
server send the gateway's credentials with every request, live updates
included. The desktop app also bundles zn 0.18.0.

Released from
[`d500ea01`](https://redirect.github.com/ZenNotes/zennotes/commit/d500ea0134a148bc5214b1d258fe031e52cc517b)
through
[#&#8203;1097](https://redirect.github.com/ZenNotes/zennotes/pull/1097)
and
[#&#8203;1098](https://redirect.github.com/ZenNotes/zennotes/pull/1098)
on 2026-11-20.

#### Features

- **Reach a server behind Cloudflare Access or another gateway**
([#&#8203;1091](https://redirect.github.com/ZenNotes/zennotes/issues/1091),
asked for by
[@&#8203;medzsikmisi](https://redirect.github.com/medzsikmisi)). An
access gateway in front of your server turns away every request that
does not carry its credentials, so nobody can reach ZenNotes at all
without them. A Cloudflare Access service token is two such credentials,
sent as headers. In Connect to Remote Vault, the Auth Token step now has
**Add extra headers**: write one `Name: value` per line.

  ```
  CF-Access-Client-Id: <client id>.access
  CF-Access-Client-Secret: <client secret>
  ```

Enter adds a line and Cmd/Ctrl+Enter connects. A remote you already
saved takes the same box under Settings, Vault, Saved Remote Workspaces,
Edit. The headers are stored in the system keychain with the auth token,
never in `config.toml`, and Settings shows only their names afterwards.
They go with every request, uploads and images included, and with the
live-update connection, so edits from other devices still arrive at
once. Keep your ZenNotes auth token in its own field: the gateway checks
the headers, then the server checks the token. Any gateway that checks
headers works the same way, for example a proxy that wants `X-Api-Key:
<key>`.

- **`zn` and the MCP server send them too.** They cannot read the
keychain, so they take the same lines from `ZENNOTES_REMOTE_HEADERS`:
the `zn` installed from Settings, CLI (`zn`, `zn tui` and `zn mcp`, from
0.18.0) and the copies bundled with the app. In an MCP client's JSON
config, write the line break as `\n`:

  ```json
"ZENNOTES_REMOTE_HEADERS": "CF-Access-Client-Id: <client
id>.access\nCF-Access-Client-Secret: <client secret>"
  ```

A value that does not parse stops the command with its line number
before anything is sent.

#### Fixes

- **A gateway that refuses says so.** When something in front of the
server turns a request away (an HTML 403), or sends it to a sign-in page
on another host, ZenNotes now names the gateway instead of showing its
page or failing with a parse error. The ZenNotes server's own refusals
keep their own words.

#### zn

- **The desktop app bundles zn 0.18.0**, which sends
`ZENNOTES_REMOTE_HEADERS` on every request
([ZenNotes/tui#54](https://redirect.github.com/ZenNotes/tui/pull/54)). A
desktop-managed `zn` already updates itself; this raises the version a
fresh install starts from.

#### Phones

- **iPhone 1.42.0 and Android 1.1.61** carry the shared core of this
release. Nothing changes on the phones themselves: their remote client
does not send extra headers yet, so the box is hidden there.

#### For contributors

- **One parser decides what a header list is**,
`packages/shared-domain/src/remote-headers.ts`, used by the connect
dialog, by the main process (which re-reads whatever a renderer sends)
and by the bundled `zn` and MCP server. zn's
`internal/remote/headers.go` mirrors it rule for rule. Authorization is
refused (the token has its own field), so are the names the connection
sets itself, and a list that does not parse is dropped whole rather than
sent in part.
- **Headers are their own secret-store entry** per remote
(`remote-workspace-headers:<id>`), beside the token. A renderer gets
only their names back (`RemoteWorkspaceProfile.headerNames`).
- **`supportsRemoteHeaders`** on the bridge capabilities hides the field
where the host's remote client does not send headers (the phones, for
now).
- **`apps/desktop/src/main/remote/gateway-headers.test.ts`** runs a stub
gateway that answers 403 in HTML unless both Cloudflare headers arrive,
and checks JSON, asset, upload and change-feed requests.

#### Verification

How to test locally:

1. Run a ZenNotes server, and in front of it anything that refuses
requests without a header. Cloudflare Access with a service token is the
real case; a local stand-in is a small proxy that answers 403 unless
`CF-Access-Client-Id` is set.
2. In ZenNotes, run Connect to Remote Vault (command palette), enter the
gateway's URL, and on the Auth Token step enter the server's token only.
Connect.
3. Before: the connection failed with a confusing error quoting the
gateway's page. After: ZenNotes says that something in front of the
server refused the request and points at the extra headers.
4. Run Connect to Remote Vault again, choose **Add extra headers**,
write the header lines, and press Cmd/Ctrl+Enter. The vault opens. Edit
a note on the server from another device: it shows up at once.
5. Quit and reopen ZenNotes: it reconnects through the gateway on its
own. Settings, Vault, Saved Remote Workspaces, Edit lists the saved
header names, never their values.
6. In a terminal: `ZENNOTES_REMOTE_HEADERS=$'CF-Access-Client-Id:
<id>\nCF-Access-Client-Secret: <secret>' zn list --server <gateway url>
--token <token>` lists the vault; without the variable, `zn` names the
gateway.

#### Distribution channels

- **GitHub:** this release, latest, with all five update feeds. Every
file they name was checked, and the app in both macOS DMGs is Notarized
Developer ID and stapled.
- **AUR:** `zennotes-bin 2.89.0-1`, pinned to the Linux tarball's
SHA-256 `611d845d…436971`.
- **Homebrew:** the `zennotes` cask in ZenNotes/homebrew-tap
(`fc75354`).
- **Nix:** `packaging/nix/release-data.json` (`abf115d4`), built on
`main` (run
[`4477292`](https://redirect.github.com/ZenNotes/zennotes/commit/44772925985)).
- **nixpkgs:**
[NixOS/nixpkgs#590905](https://redirect.github.com/NixOS/nixpkgs/pull/590905),
`zennotes-desktop: 2.88.0 -> 2.89.0`, waiting for nixpkgs review. The
previous bump to 2.88.0 merged.
- **Self-hosted server and Docker:** unchanged; server 2.84.1 is
current.
- **zn:**
[0.18.0](https://redirect.github.com/ZenNotes/tui/releases/tag/v0.18.0),
released first and bundled here; the Homebrew `zn` formula is on 0.18.0
too.
- **Phones:** iPhone 1.42.0 is Waiting for Review on the App Store.
Android 1.1.61 is in review on Google Play, and its [GitHub
release](https://redirect.github.com/ZenNotes/zennotesandroid/releases/tag/v1.1.61)
carries Play's signed universal APK. Both carry the shared core
`core-2.89.0-core.hf590792c335f6b1a`, published as a pre-release.
- **Website:** the release page on zennotes.org, the Cloudflare Access
guide in the docs, and zn 0.18.0 on the CLI releases page.

#### Release validation

- On `d500ea01`: typecheck, every test suite uncached (shared-domain
2715, portable-vault 398, app-core 4949, quicklook 18, web 76, desktop
1961), `build:prod`, `npm run pack` and the packaged launch check (page
target, rendered, 2.89.0), and the three smoke suites. No hazards, no
audit findings, no long dashes.
- The headers were driven end to end against a stub gateway that answers
403 in HTML unless both Cloudflare headers arrive: connect, reopen, live
changes, assets and uploads, and `zn` with `ZENNOTES_REMOTE_HEADERS`.
- The gate found two things before the cut. The custom themes watcher
could report a change after it was stopped, which surfaced as an
unhandled rejection in its test; fixed, with a test that fails on the
old code. Four moderate production advisories (hono,
[@&#8203;hono/node-server](https://redirect.github.com/hono/node-server),
fast-uri, ip-address) were bumped. Every check ran again on the new
commit.
- After the go, CI on `main` failed on Linux arm64: the same watcher
could still report from a folder read already in flight when it stopped.
That was fixed too (`d500ea01`, reports now need the watcher to still be
current), every check ran again, and `main` passed on every platform at
`d500ea01` before the tag.
- On the fix's pull request, the Windows x64 runner failed three times
on tests unrelated to the change: an ordered-list test that reads a
parse its setup never stores (a test bug, fixed next release), then
disk-heavy tests timing out on a slow runner. `main` passed Windows at
the tagged commit.
- CodeQL flagged a one-line `.replace` in a test fixture; it was
dismissed as test-only.
- The phones were walked on the release builds before either store:
Android 1.1.61 on an Android 17 emulator and iPhone 1.42.0 on an iOS
27.2 simulator, fresh installs, with onboarding, a note on disk and the
one-field Auth Token step. The Android pull request's emulator job could
not boot on a runner without hardware acceleration, so the local walk
stood in for it. The iPhone Cloud UI tests were skipped (no Cloud
change).
- Not tested before release: packaged Windows and Linux builds beyond
CI, and a real Cloudflare Access deployment (the stub gateway stands in
for it).

</details>

---

### Configuration

📅 **Schedule**: (in timezone America/Los_Angeles)

- Branch creation
  - Every minute (`* * * * *`)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, 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/scottames/copr).

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

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
MichaelC001 pushed a commit to MichaelC001/zennotes that referenced this pull request Nov 21, 2026
zn 0.18.1 (ZenNotes/tui v0.18.1, ZenNotes/tui#55) records a new note's creation date the moment it makes the note, so on Windows a note made again under a deleted note's name keeps its own date, the same fix this release makes in the app and its MCP server (bf4f86c). The pin is that release's signed terminal-release.json, verified against zn-release-1 and copied byte for byte; the staged binary reports zn v0.18.1. The in-app help's CLI card names 0.18.1 and desktop 2.90.0.
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.

1 participant