diff --git a/src/backend/controllers/types.ts b/src/backend/controllers/types.ts index 3236355eb..1ea97f2a1 100644 --- a/src/backend/controllers/types.ts +++ b/src/backend/controllers/types.ts @@ -63,7 +63,7 @@ export const PuterController = public onServerShutdown() { return; } - public getReportedCosts(): Record[] { + public async getReportedCosts() { return []; } public registerRoutes(_router: PuterRouter) {} diff --git a/src/backend/extensions.ts b/src/backend/extensions.ts index 7a8e8bdc3..561b8939f 100644 --- a/src/backend/extensions.ts +++ b/src/backend/extensions.ts @@ -278,9 +278,19 @@ export const extension = { get: (_target: object, prop: string) => { const proxiedObj = clientsContainers[prop]; if (!proxiedObj) { - throw new Error( - `Called before initialization: ${name}.${prop}`, - ); + const proxyProxyHandler = { + get: (_target2: object, prop2: string) => { + const proxiedObj2 = + clientsContainers[prop][prop2]; + if (!proxiedObj2) { + throw new Error( + `extension.import('client:${prop}') missing property '${prop2}'`, + ); + } + return proxiedObj2; + }, + }; + return new Proxy({}, proxyProxyHandler) as object; } return proxiedObj; }, @@ -292,10 +302,21 @@ export const extension = { const proxyHandler = { get: (_target: object, prop: string) => { const proxiedObj = storesContainers[prop]; + if (!proxiedObj) { - throw new Error( - `Called before initialization: ${name}.${prop}`, - ); + const proxyProxyHandler = { + get: (_target2: object, prop2: string) => { + const proxiedObj2 = + clientsContainers[prop][prop2]; + if (!proxiedObj2) { + throw new Error( + `extension.import('client:${prop}') missing property '${prop2}'`, + ); + } + return proxiedObj2; + }, + }; + return new Proxy({}, proxyProxyHandler) as object; } return proxiedObj; }, @@ -307,10 +328,21 @@ export const extension = { const proxyHandler = { get: (_target: object, prop: string) => { const proxiedObj = servicesContainers[prop]; + if (!proxiedObj) { - throw new Error( - `Called before initialization: ${name}.${prop}`, - ); + const proxyProxyHandler = { + get: (_target2: object, prop2: string) => { + const proxiedObj2 = + clientsContainers[prop][prop2]; + if (!proxiedObj2) { + throw new Error( + `extension.import('client:${prop}') missing property '${prop2}'`, + ); + } + return proxiedObj2; + }, + }; + return new Proxy({}, proxyProxyHandler) as object; } return proxiedObj; }, @@ -322,10 +354,21 @@ export const extension = { const proxyHandler = { get: (_target: object, prop: string) => { const proxiedObj = controllersContainers[prop]; + if (!proxiedObj) { - throw new Error( - `Called before initialization: ${name}.${prop}`, - ); + const proxyProxyHandler = { + get: (_target2: object, prop2: string) => { + const proxiedObj2 = + clientsContainers[prop][prop2]; + if (!proxiedObj2) { + throw new Error( + `extension.import('client:${prop}') missing property '${prop2}'`, + ); + } + return proxiedObj2; + }, + }; + return new Proxy({}, proxyProxyHandler) as object; } return proxiedObj; }, @@ -337,10 +380,21 @@ export const extension = { const proxyHandler = { get: (_target: object, prop: string) => { const proxiedObj = driversContainers[prop]; + if (!proxiedObj) { - throw new Error( - `Called before initialization: ${name}.${prop}`, - ); + const proxyProxyHandler = { + get: (_target2: object, prop2: string) => { + const proxiedObj2 = + clientsContainers[prop][prop2]; + if (!proxiedObj2) { + throw new Error( + `extension.import('client:${prop}') missing property '${prop2}'`, + ); + } + return proxiedObj2; + }, + }; + return new Proxy({}, proxyProxyHandler) as object; } return proxiedObj; }, diff --git a/src/backend/services/fs/FSService.ts b/src/backend/services/fs/FSService.ts index 283e706db..681dd3ea8 100644 --- a/src/backend/services/fs/FSService.ts +++ b/src/backend/services/fs/FSService.ts @@ -3060,7 +3060,7 @@ export class FSService extends PuterService { {}, ); } catch { - // Non-critical — the response is the source of truth. + console.warn('missing event emissions'); } }