bjsi / bjsi/incremental-writing
BUG: withExtension is very broken, mangling file some names
- Dominant language
- TypeScript
- Stars
- 209
- Forks
- 16
- PR merge metrics
- No merged PRs in 30d
Description
I was wondering why my `iwq_extended` queue would always be missed by adds, with them instead ending up in `iwq_extende` instead. Yet targeting `iwq_extended_` _would_ put them there... Turns out `rtrim` is either completely broken or working exactly as intended but a very wrong tool for the job:
```js
"extended.md".rtrim(".md") // --> "extende"
"extendeddddddd.md".rtrim(".md") // --> "extende"
"extendedmmd.d.d.....mmmmdddmmmm......".rtrim(".md") // --> "extende"
```
Given that "add to queue" already adds the extension, I have no clue what the `.rtrim(".md") + ".md"` was supposed to achieve. (`rtrim` is also used at least to generate status bar text, so that's not the only problem.)
Contributor guide
No contributing guide indexed for this repository
Research direction
Search the plugin for the `rtrim(".md")` calls, then trace both queue-add handling and status bar text generation. Reproduce the examples from the issue and verify that queue names and displayed names preserve the intended filename while still handling the `.md` extension correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100