final automerge errors on cloudflare
This commit is contained in:
parent
f2b05a8fe6
commit
62afed445e
|
|
@ -44,7 +44,7 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus
|
||||||
// JSON sync is deprecated - all data now flows through Automerge sync protocol
|
// 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
|
// 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
|
// 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.')
|
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
|
// Don't apply JSON sync - let Automerge sync handle everything
|
||||||
return
|
return
|
||||||
|
|
@ -118,7 +118,7 @@ export function useAutomergeSync(config: AutomergeSyncConfig): TLStoreWithStatus
|
||||||
// Continue anyway - user can still create new content
|
// 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 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
|
const finalShapeCount = finalDoc?.store ? Object.values(finalDoc.store).filter((r: any) => r?.typeName === 'shape').length : 0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1264,7 +1264,7 @@ export class AutomergeDurableObject {
|
||||||
const docFromBucket = await this.r2.get(`rooms/${this.roomId}`)
|
const docFromBucket = await this.r2.get(`rooms/${this.roomId}`)
|
||||||
if (docFromBucket) {
|
if (docFromBucket) {
|
||||||
try {
|
try {
|
||||||
const r2Doc = await docFromBucket.json()
|
const r2Doc = await docFromBucket.json() as any
|
||||||
r2ShapeCount = r2Doc.store ?
|
r2ShapeCount = r2Doc.store ?
|
||||||
Object.values(r2Doc.store).filter((r: any) => r?.typeName === 'shape').length : 0
|
Object.values(r2Doc.store).filter((r: any) => r?.typeName === 'shape').length : 0
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue