Repository navigation
fix(app): shorten export filenames for long session titles - #60347
Conversation
There was a problem hiding this comment.
This looks good to merge. On the base, I reproduced the problem with the new test: a 300-character title produced a 305-byte filename. With this change the name is capped at 255 bytes and still ends in .json. I also checked a few edge cases: a dash right at the cut point is trimmed, and titles with only non-ASCII characters or symbols still fall back to the session id. Since the cleaned name is plain ASCII, the 250-character cap is also a 250-byte cap. The export tests pass (7/7) and tsc -b passes for packages/app.
Public API is unchanged: this only affects the suggested export filename on your machine.
No concerns.
There was a problem hiding this comment.
The new commits drop the code comment and make the test check the exact filename. The fix itself is unchanged and still works: the updated test fails on the base and passes here (7/7), and tsc -b passes for packages/app.
The public API is unchanged.
No concerns.
Issue for this PR
Closes #54721
Type of change
What does this PR do?
Caps the cleaned export filename at 250 characters before trimming trailing dashes, leaving room for
.jsonwithin the 255-byte filesystem component limit. This prevents long session titles from producing unsavable export filenames.The added regression uses a 300-character title and checks the final byte length and extension.
How did you verify your code works?
cd packages/app && bun test src/session/commands/export.test.ts: 7 passed, 0 failed.bun run typecheckwith Node 22: 35/35 tasks passed.Visual
N/A — no visual change.
Screenshots / recordings
N/A — filename generation correctness.
Checklist