Repository navigation
feat(export): include projects and skills in the account export - #43
Conversation
The account export already bundled chats, messages, memories, memory packs and settings, but not projects or skills - so a full export dropped every project's custom instructions and every skill's body, which is most of what is worth backing up. Whole rows rather than listProjects/listSkills: those shape their results for the sidebar and the picker, and neither carries instructions or body. The payload assembly moves to lib/account-export.ts so its shape can be tested without a database. The failure mode for an export is silent omission - a table gets added and nobody remembers to export it - so the test asserts every user-owned collection is present rather than spot-checking a few. Closes charandeep-reddy#30
|
@webdevsamran is attempting to deploy a commit to the charan Team on Vercel. A member of the Team first needs to authorize it. |
|
This one's basically there. One thing: the skills query in Small non-blocking note: the export route now does 7 independent queries sequentially — could be a |
charandeep-reddy
left a comment
There was a problem hiding this comment.
Merging as-is and applying the review comment directly on main (reuse listSkills instead of duplicating the query).
…lelize the account export listSkills(userId) with no options already returns every column including body — the hand-rolled select in the export route was an exact duplicate that would drift the next time that function changes. Also runs the seven independent per-collection queries concurrently instead of sequentially, per the non-blocking note on #43 — export latency scales with the slowest one now, not the sum.
Closes #30
What was missing
/api/account/exportalready bundles chats (with messages), memories, memory packs and settings. It does not include projects or skills.That means a full export drops every project's
instructionsand every skill'sbody/resources— for a BYOK tool whose premise is "your data, your key, your account", those are most of what is worth backing up.Change
projectandskillrows, scoped byuserIdlike every other query.Deliberately not
listProjects/listSkills: those shape their results for the sidebar and the picker, and neither carriesinstructionsorbody.src/lib/account-export.tsso the shape is testable without a database.On the format
Kept the existing single JSON file rather than a zip. The issue left this open; JSON needs no new client-side dependency, and memories/projects/settings are structured data that a Markdown bundle would flatten. Per-chat Markdown already exists via
chatToMarkdownin the share button.Import/restore stays out of scope, as the issue says.
Tests
New
tests/account-export.test.ts. The failure mode for an export is silent omission — a table gets added and nobody remembers to export it — so it asserts every user-owned collection is present viaACCOUNT_EXPORT_COLLECTIONSrather than spot-checking, plus that project instructions and skill bodies survive, and that no API key ever appears.Verified the test catches the actual bug: against the pre-fix payload shape it fails with
export is missing "projects"; it passes after.The API key is untouched — it is
localStorage-only and never reaches the server.