Skip to content

Commit df1cf85

Browse files
authored
Fix: Re-throw default pattern creation errors instead of swallowing (commontoolsinc#2071)
**Problem:** Errors in DefaultPattern.create() were caught and logged but not re-thrown, causing silent failures. **Why this breaks mentions:** 1. linkDefaultPattern() fails (network glitch, race condition, etc.) 2. Error is swallowed → no indication to user 3. DefaultCharmList charm created successfully 4. But /defaultPattern link in space cell is missing 5. wish("#mentionable") resolves path: /defaultPattern/backlinksIndex/mentionable 6. Path resolution fails because /defaultPattern doesn't exist 7. Returns empty array instead of charm list 8. ct-code-editor receives empty mentionable list 9. [[ dropdown shows no completions **Symptom:** Type [[ in notes field → dropdown is empty (even though backlinksIndex has data) **Timeline:** - Oct 23 (947b471): linkDefaultPattern added - Nov 6 (or earlier): Spaces created with transient link failures - Today: Error swallowing discovered **Fix:** Re-throw errors to surface failures immediately. Future spaces will fail loudly if linking doesn't work, preventing silent corruption. **Workaround for affected spaces:** Delete packages/toolshed/cache/memory/*.sqlite and recreate spaces.
1 parent 2497e88 commit df1cf85

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/shell/src/views/BodyView.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ export class XBodyView extends BaseView {
8585
await DefaultPattern.create(this.rt.cc());
8686
} catch (error) {
8787
console.error("Could not create default pattern:", error);
88+
// Re-throw to expose errors instead of swallowing them
89+
throw error;
8890
} finally {
8991
this.creatingDefaultPattern = false;
9092
this._charms.run();

0 commit comments

Comments
 (0)