Obsidian export leaves leading and trailing dots in note names
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- python, typescript
Direzione di ricerca
Leggi src/selfgraph/_export.py e typescript/src/export.ts, concentrandoti su _stem e stem; l’issue include riproduzioni che mostrano che entrambi gli SDK restituiscono nomi errati. Controlla come si comporta la pulizia prima e dopo il troncamento in base alla lunghezza in byte, quindi esegui i test di esportazione esistenti per entrambi gli SDK. Il lavoro è completato quando gli esempi producono NET.md, Acme.md e v1.md e la pulizia rimane idempotente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
export_obsidian can write a note whose file name starts or ends with a dot, though the note name cleanup is meant to remove both. A name that starts with a dot is a hidden file, which Obsidian does not index, so that entity's note and every link to it are missing from the vault.
Tested at 5a277c9 (current main).
Reproduce
import asyncio, os, tempfile
from selfgraph import KuzuStore, SelfGraph
async def main():
async with SelfGraph(store=KuzuStore(os.path.join(tempfile.mkdtemp(), "g.kuzu"))) as g:
for name in [". .NET", "Acme. .", "v1. ."]:
await g.entities.create(name, "Product")
print(sorted(await g.export_obsidian()))
asyncio.run(main())
['.NET.md', 'Acme..md', 'v1..md']
Expected NET.md, Acme.md, and v1.md. The same names go through selfgraph export obsidian, which writes these paths to disk.
Cause
_stem in src/selfgraph/_export.py:142 runs .strip().strip(".").strip() once. Stripping the dots exposes whitespace, and stripping that whitespace exposes more dots, which are left in place:
from selfgraph._export import _stem
_stem(". .NET") # '.NET'
_stem("Acme. .") # 'Acme.'
_stem(_stem("Acme. .")) # 'Acme', so the function is not idempotent either
The TypeScript stem in typescript/src/export.ts:145 nests pyStrip the same way and gives the same names.
Suggested fix
Repeat the whitespace and dot strip until the value stops changing, in both SDKs. Apply the same cleanup after the byte-length truncation.
- Lingua principale
- TypeScript
- Stelle
- 173
- Fork
- 58
- Merge medio
- 6h
- PR unite (30g)
- 120
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di hydra-db/selfgraph
-
approved-for-pr area: cli-mcp area: errors bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
hydra-db/selfgraph#401 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: errors area: store bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
hydra-db/selfgraph#398 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: errors area: write bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
hydra-db/selfgraph#392 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
approved-for-pr area: parity area: write bug effort: S P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
hydra-db/selfgraph#391 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di hydra-db/selfgraph
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
code-yeongyu/senpi#7139 ·
I maintainer di solito rispondono entro 1 giorno
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
lingdojo/kana-dojo#34395 · 1 commento · 5 reazioni ·
I maintainer di solito rispondono entro 1 giorno
-
bug status: needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
mastra-ai/mastra#31093 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area:web p2 product:business triage:active type:bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 89/100
cuadrao-ai/argus#2328 ·
I maintainer di solito rispondono entro 1 giorno
-
bug frontend good first issue help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
nikhilb2/simple_invoicing#907 ·