Repository navigation
Conversation
|
The following comment was made by an LLM, it may be inaccurate: |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
There was a problem hiding this comment.
The fix works. Calling sessionExportFilename with a 300-character title gives a 305-byte filename on the base and 255 bytes with this change. export.test.ts and the app package's typecheck both pass.
Public API: unchanged. The change is internal to the web app's export filename helper.
One small thing: when the 250-character cut lands just after a hyphen, the name keeps a trailing - (see the inline comment).
| .replace(/^-+|-+$/g, "") | ||
| // The sanitized basename is ASCII-only, so capping characters keeps the | ||
| // filename within the 255-byte filesystem component limit with ".json". | ||
| .slice(0, 250) |
There was a problem hiding this comment.
The leading/trailing hyphen trim on line 43 runs before this cut, so a cut that lands right after a separator leaves a trailing -. For example, a title of "a".repeat(249) + " bcd" exports as aaa…a-.json. Moving .slice(0, 250) above the .replace(/^-+|-+$/g, "") (or trimming again after it) keeps names clean.
2f70786 to
f864447
Compare
Issue for this PR
Closes #54721
Type of change
What does this PR do?
sessionExportFilename had no length cap, so a long session title produced an unsavable filename over the 255-byte limit. Caps the sanitized ASCII basename at 250 chars, leaving room for .json.
How did you verify your code works?
Confirmed a 300-char title now yields a 255-byte filename. Added a regression test asserting the capped name and length.
Screenshots / recordings
N/A - logic change, no UI change.
Checklist