Pass /data/ paths through subdomain routing without rewriting so
generated image files are accessible on *.rspace.online subdomains.
Move image upload/generate section above the compose textarea in the
thread builder editor layout.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Automerge throws "Cannot create a reference to an existing document
object" when assigning an Automerge proxy object back into the doc.
Now JSON round-trips the thread data before writing, and strips null
fields that should be absent rather than null in the document.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- tweetImages and imageUrl set to null instead of undefined when empty
(Automerge rejects undefined as invalid JSON)
- Updated ThreadData schema to allow null for optional fields
- This was the root cause of the 404 on image generation: saveDraft
threw on undefined, so the thread never synced to the server, and
the server-side route returned "Thread not found"
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two bugs:
- subscribeOffline() bailed if runtime wasn't initialized yet (race with
shell.ts init). Now waits for runtime to appear, then awaits init().
- getDoc() called runtime.getDoc() which doesn't exist — method is
runtime.get(). Caused "e.getDoc is not a function" crash in listThreads.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
All callers of saveDraft() and saveToAutomerge() in generateImage,
uploadImage, uploadTweetImage, generateTweetImage, removeTweetImage,
and share handler now properly await these async methods. Without await,
runtime.change() fires before the Automerge doc subscription resolves,
causing "Document not open" errors.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
basePath was always returning /{space}/rsocials/ which works for path-based
routing (rspace.online/jeff/rsocials/) but double-prefixes on subdomain
routing (jeff.rspace.online/jeff/rsocials/ → rewritten to /jeff/jeff/rsocials/).
Now detects subdomain hosts (*.rspace.online, *.rsocials.online) and returns
/rsocials/ without the space prefix, since the space is the subdomain.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two bugs fixed:
- attachShadow called unconditionally in connectedCallback, crashing on
re-insertion ("Shadow root cannot be created on a host which already
hosts a shadow tree")
- saveToAutomerge/deleteFromAutomerge called runtime.change() before the
async subscribeOffline() had resolved, causing "Document not open" errors
Now tracks the subscribe promise and awaits it before any write operation.
Also guards shadow root creation in gallery and campaign manager components.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>