final automerge errors on cloudflare

This commit is contained in:
Jeff Emmett 2025-11-10 18:01:36 -08:00
parent f2b05a8fe6
commit 62afed445e
2 changed files with 3 additions and 3 deletions

View File

@ -44,7 +44,7 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus
// JSON sync is deprecated - all data now flows through Automerge sync protocol
// Old format content is converted server-side and saved to R2 in Automerge format
// This callback is kept for backwards compatibility but should not be used
const applyJsonSyncData = useCallback((data: TLStoreSnapshot) => {
const applyJsonSyncData = useCallback((_data: TLStoreSnapshot) => {
console.warn('⚠️ JSON sync callback called but JSON sync is deprecated. All data should flow through Automerge sync protocol.')
// Don't apply JSON sync - let Automerge sync handle everything
return
@ -118,7 +118,7 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus
// Continue anyway - user can still create new content
}
const finalDoc = handle.doc()
const finalDoc = handle.doc() as any
const finalStoreKeys = finalDoc?.store ? Object.keys(finalDoc.store).length : 0
const finalShapeCount = finalDoc?.store ? Object.values(finalDoc.store).filter((r: any) => r?.typeName === 'shape').length : 0

View File

@ -1264,7 +1264,7 @@ export class AutomergeDurableObject {
const docFromBucket = await this.r2.get(`rooms/${this.roomId}`)
if (docFromBucket) {
try {
const r2Doc = await docFromBucket.json()
const r2Doc = await docFromBucket.json() as any
r2ShapeCount = r2Doc.store ?
Object.values(r2Doc.store).filter((r: any) => r?.typeName === 'shape').length : 0