{"record":{"id":"97d9f1589db4d71a","repo":"HeyPuter/puter","slug":"bad-request-97d9f1","errorCode":"bad_request","errorMessage":"Missing or invalid `object`","messagePattern":"Missing or invalid `object`","errorType":"http","errorClass":"HttpError","httpStatus":400,"severity":"error","filePath":"src/backend/drivers/notification/NotificationDriver.ts","lineNumber":89,"sourceCode":"        },\n    };\n\n    readonly concurrent: DriverConcurrentConfig = {\n        default: {\n            limit: 20,\n            bySubscription: {\n                [DEFAULT_FREE_SUBSCRIPTION]: 10,\n                [DEFAULT_TEMP_SUBSCRIPTION]: 5,\n            },\n        },\n    };\n\n    // -- Driver methods ----------------------------------------------\n\n    async create(args: Record<string, unknown>): Promise<unknown> {\n        const object = args.object as Record<string, unknown> | undefined;\n        if (!object || typeof object !== 'object') {\n            throw new HttpError(400, 'Missing or invalid `object`', {\n                legacyCode: 'bad_request',\n            });\n        }\n        const actor = this.#requireUserActor();\n\n        const value = object.value ?? {};\n        const created = await this.stores.notification.create({\n            userId: actor.user.id,\n            value,\n        });\n        return this.#toClient(created);\n    }\n\n    async read(args: Record<string, unknown>): Promise<unknown> {\n        const actor = this.#requireUserActor();\n        const uid = (args.uid ?? args.id) as string | undefined;\n        if (!uid)\n            throw new HttpError(400, 'Missing `uid`', {","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/HeyPuter/puter/blob/908ec23eda38526170322c3edf71ba45ecb1ca95/src/backend/drivers/notification/NotificationDriver.ts#L71-L107","documentation":"NotificationDriver.create() requires an `object` argument that is an object (the notification envelope, with the payload under object.value). Missing, null, or non-object input is rejected. This method is intended for server-internal callers pushing notifications, not end-user apps.","triggerScenarios":"Calling /drivers/call on puter-notifications create with { } and no object key; passing a bare string payload; passing object: null.","commonSituations":"Shaping the driver/call payload wrong (passing value directly instead of wrapped in object); migrating from a flat payload to the object envelope; internal service forgetting the wrapper.","solutions":["Wrap the notification payload: { object: { value: { ... } } }.","Ensure object is a non-null object before the call."],"exampleFix":"// before\nawait notifications.create({ text: 'hi' });\n\n// after\nawait notifications.create({ object: { value: { text: 'hi' } } });","handlingStrategy":"validation","validationCode":"if (!object || typeof object !== 'object') {\n  throw new TypeError('notifications.create requires an object envelope');\n}\nawait notifications.create({ object });","typeGuard":"const isNotificationObject = (v: unknown): v is Record<string, unknown> =>\n  typeof v === 'object' && v !== null;","tryCatchPattern":null,"preventionTips":["Wrap payloads: { object: { value: { ... } } }.","Remember create is server-internal; use the correct caller context."],"tags":["notifications","validation","bad-request"],"backgroundTag":null,"analyzedSha":"908ec23eda38526170322c3edf71ba45ecb1ca95","analyzedAt":"2026-08-12T20:53:15.911Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}