Skip to content

Honeycrisp: notes reset to "Untitled / No content" after logout + browser restart #1590

@Leftium

Description

@Leftium

Bug Description

Bug:

Notes in honeycrisp reset to “Untitled / No content” after logout and browser restart. The first auto-selected note resets immediately; other notes reset when clicked. Body content is not permanently lost on the server—it merges back if you type into the empty editor—but the table row metadata (title, preview, word count) is overwritten with empty values permanently.

Expected behavior:

All notes retain their title, preview, and body content after logout + re-login.

Steps to reproduce:

  1. Log in to Honeycrisp, create 3 notes with distinct titles and body content
  2. Log out
  3. Quit the browser
  4. Reopen the browser, log in
  5. First note shows “Untitled / No content”; clicking the others resets them too

Additional context:

Editor.svelte:127-130 fires extractTitleAndPreview(ed) immediately on mount, before the content doc’s WebSocket sync has delivered data. The sync extension’s whenReady resolves after provider.connect() is called, not after the handshake completes—so the editor sees an empty Y.XmlFragment and writes { title: '', preview: '', wordCount: 0 } to the table row. LWW semantics make the empty write permanent.

Fix: remove lines 127-130. The onUpdate handler at line 104-106 already fires when content arrives from sync.

Open question: content doc IndexedDBs survive clearLocalData(), so y-indexeddb should load cached body content before the editor mounts. The bug was reproduced on a repeat login in the same browser, suggesting either the IDB write debounce (1s) didn’t flush before quit, or something in the logout sequence affects content doc persistence. This doesn’t change the fix—the initial extraction is wrong regardless.

Before logout:
Image

After login:
Image

After click other notes:
Image

After edit blank notes from above (simply edited each note to "A", "B", "C")
Image

Platform

Web

Affected Component

Sync (sync server/client)

Epicenter Version

n/a

Severity

Critical (application unusable or data loss)

Discord Link

https://discord.com/channels/1391098486178582549/1403145437434745044/1489585248814633122

Checklist

  • I have searched existing issues to ensure this hasn't been reported

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugA defect or unexpected behavior that needs fixing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions